diff --git a/module/rdd-main.js b/module/rdd-main.js index 40cb47b7..63680276 100644 --- a/module/rdd-main.js +++ b/module/rdd-main.js @@ -267,7 +267,7 @@ async function migrationPngWebp_1_5_34() { return img.replace(regexOldPngJpg, replaceWithWebp); } function prepareDocumentsImgUpdate(documents) { - return documents.filter(it => it.img.match(regexOldPngJpg)) + return documents.filter(it => it.img && it.img.match(regexOldPngJpg)) .map(it => { return { _id: it.id, img: convertImgToWebp(it.img) } }); @@ -278,7 +278,7 @@ async function migrationPngWebp_1_5_34() { await Item.updateDocuments(itemsUpdates); await Actor.updateDocuments(actorsUpdates); game.actors.forEach(actor => { - if (actor.data.token.img.match(regexOldPngJpg)){ + if (actor.data.token?.img && actor.data.token.img.match(regexOldPngJpg)){ actor.update({ "token.img": convertImgToWebp(actor.data.token.img) }); } const actorItemsToUpdate = prepareDocumentsImgUpdate(actor.items); diff --git a/system.json b/system.json index c2931dad..25ace6c4 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.5.34", + "version": "1.5.35", "manifestPlusVersion": "1.0.0", "minimumCoreVersion": "0.8.0", "compatibleCoreVersion": "0.8.9",