From 083bd0c9fe196dbc15d6e6d8a63cd2935273a75c Mon Sep 17 00:00:00 2001 From: Innocent Maina <62073759+InnocentWahome@users.noreply.github.com> Date: Thu, 12 Oct 2023 13:13:36 +0300 Subject: [PATCH] Update ussd-menu.js --- lib/ussd-menu.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ussd-menu.js b/lib/ussd-menu.js index 0423df8..60d233a 100644 --- a/lib/ussd-menu.js +++ b/lib/ussd-menu.js @@ -132,7 +132,7 @@ class UssdMenu extends EventEmitter { */ resolveRoute(route, callback) { // separate route parts - var parts = route === '' ? [] : route.split('*'); + var parts = route === ''? [] : route?.split('*') || []; // follow the links from start state var state = this.states[UssdMenu.START_STATE]; @@ -610,4 +610,4 @@ class UssdState { } -module.exports = UssdMenu; \ No newline at end of file +module.exports = UssdMenu;