From 7f0254701c5fd502712069c64defc6992552b26d Mon Sep 17 00:00:00 2001 From: Bryan Ashby Date: Wed, 14 Dec 2022 19:56:43 -0700 Subject: [PATCH] Ensure we have a message list --- core/msg_list.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/core/msg_list.js b/core/msg_list.js index 19d8f78c..4dc4931f 100644 --- a/core/msg_list.js +++ b/core/msg_list.js @@ -70,6 +70,14 @@ exports.getModule = class MessageListModule extends ( this.menuMethods = { selectMessage: (formData, extraArgs, cb) => { + if (!Array.isArray(this.config?.messageList)) { + this.client.log.error( + { formData }, + 'No message list is available to select from!' + ); + return cb(null); + } + if (MciViewIds.allViews.msgList === formData.submitId) { // 'messageIndex' or older deprecated 'message' member this.initialFocusIndex = _.get(