From e13750ea6849855eb377424574d6307d253dcf92 Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Tue, 1 Jun 2021 00:10:02 +0200 Subject: [PATCH] removeChatMessageId support undefined MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Simplifie le code de l'appelant préparation pour enchantement de potions --- module/chat-utility.js | 4 +++- module/rdd-utility.js | 5 +---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/module/chat-utility.js b/module/chat-utility.js index 06eb5fac..8379e146 100644 --- a/module/chat-utility.js +++ b/module/chat-utility.js @@ -40,7 +40,9 @@ export class ChatUtility { } static removeChatMessageId(messageId) { - ChatUtility.removeMessages({ messageId: messageId }); + if (messageId){ + ChatUtility.removeMessages({ messageId: messageId }); + } } /* -------------------------------------------- */ diff --git a/module/rdd-utility.js b/module/rdd-utility.js index f3c36f7c..68a4a7c0 100644 --- a/module/rdd-utility.js +++ b/module/rdd-utility.js @@ -614,10 +614,7 @@ export class RdDUtility { let actor = RdDUtility.getSelectedActor("Pour effectuer le paiement:"); if (actor) { actor.depenserDeniers(sumdenier, objData, quantite, fromActorId); - let chatMessageId = RdDUtility.findChatMessageId(event.currentTarget); - if (chatMessageId) { - ChatUtility.removeChatMessageId(chatMessageId); - } + ChatUtility.removeChatMessageId(RdDUtility.findChatMessageId(event.currentTarget)); } }); }