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)); } }); }