From 9113fae4fe975b1cb9abf4c9ab66931f3636f1b1 Mon Sep 17 00:00:00 2001 From: Wolfsblvt Date: Wed, 26 Jun 2024 02:46:53 +0200 Subject: [PATCH] Fix /addswipe error if swipe_info not initialized --- public/scripts/slash-commands.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/public/scripts/slash-commands.js b/public/scripts/slash-commands.js index ebbbd42b1..453c9205f 100644 --- a/public/scripts/slash-commands.js +++ b/public/scripts/slash-commands.js @@ -1998,6 +1998,9 @@ async function addSwipeCallback(_, arg) { lastMessage.swipe_info = [{}]; lastMessage.swipe_id = 0; } + if (!Array.isArray(lastMessage.swipe_info)) { + lastMessage.swipe_info = lastMessage.swipes.map(() => ({})); + } lastMessage.swipes.push(arg); lastMessage.swipe_info.push({