From 33e7b7acfae09358f282ba31831a98cabc247aa3 Mon Sep 17 00:00:00 2001 From: HorizonCode Date: Wed, 10 Aug 2022 14:32:56 +0200 Subject: [PATCH] fix undefined error when ctrl+c in interactive menu --- index.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/index.js b/index.js index 7b1042f..b27eb89 100644 --- a/index.js +++ b/index.js @@ -16,6 +16,9 @@ const BACKUPS_DIRECTORY = path.join(CURRENT_FOLDER, 'backups'); const TEMP_DIR = path.join(CURRENT_FOLDER, '.temp'); const run = async (programArgs) => { + if (programArgs === undefined || programArgs.action === undefined) { + return; + } const ACTION = programArgs.action.toLowerCase(); switch (ACTION) { case 'exit':