diff --git a/module/rdd-alchimie.js b/module/rdd-alchimie.js index 1029f0f1..4028bc1d 100644 --- a/module/rdd-alchimie.js +++ b/module/rdd-alchimie.js @@ -10,14 +10,16 @@ export class RdDAlchimie { let manip = duplicate(recette.data.manipulation); let reg1 = new RegExp(/@(\w*){([\w\-]+)}/ig); let matchArray = manip.match( reg1 ); - for( let matchStr of matchArray) { - let reg2 = new RegExp(/@(\w*){([\w\-]+)}/i); - let result = matchStr.match(reg2); - //console.log("RESULT ", result); - if ( result[1] && result[2]) { - let commande = Misc.upperFirst( result[1] ); - let replacement = this[`_alchimie${commande}`](recette, result[2], actorId); - manip = manip.replace( result[0], replacement); + if ( matchArray ) { + for( let matchStr of matchArray) { + let reg2 = new RegExp(/@(\w*){([\w\-]+)}/i); + let result = matchStr.match(reg2); + //console.log("RESULT ", result); + if ( result[1] && result[2]) { + let commande = Misc.upperFirst( result[1] ); + let replacement = this[`_alchimie${commande}`](recette, result[2], actorId); + manip = manip.replace( result[0], replacement); + } } } recette.data.manipulation_update = manip; diff --git a/system.json b/system.json index 81f3a4ba..121d15e6 100644 --- a/system.json +++ b/system.json @@ -2,7 +2,7 @@ "name": "foundryvtt-reve-de-dragon", "title": "Rêve de Dragon", "description": "Rêve de Dragon RPG for FoundryVTT", - "version": "1.2.4", + "version": "1.2.5", "minimumCoreVersion": "0.7.5", "compatibleCoreVersion": "0.7.8", "templateVersion": 80,