From d792d736d440e595f62b54d26289a60d7e78b4c1 Mon Sep 17 00:00:00 2001 From: sladecraven Date: Thu, 11 Nov 2021 09:25:38 +0100 Subject: [PATCH] Gestion plus fines des entites et corrections sur initiative #195 --- module/rdd-main.js | 4 ++-- system.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) 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",