From 74cc8792916fdb09976cb934e686d14857ed90fe Mon Sep 17 00:00:00 2001 From: Lukas Holzer Date: Fri, 17 Dec 2021 21:30:08 +0100 Subject: [PATCH] fix(switch): fix switch command error when no user logged in (#3851) --- src/commands/switch/switch.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/commands/switch/switch.js b/src/commands/switch/switch.js index b0281580089..33d80331965 100644 --- a/src/commands/switch/switch.js +++ b/src/commands/switch/switch.js @@ -12,7 +12,7 @@ const LOGIN_NEW = 'I would like to login to a new account' * @param {import('../base-command').BaseCommand} command */ const switchCommand = async (options, command) => { - const availableUsersChoices = Object.values(command.netlify.globalConfig.get('users')).reduce( + const availableUsersChoices = Object.values(command.netlify.globalConfig.get('users') || {}).reduce( (prev, current) => Object.assign(prev, { [current.id]: current.name ? `${current.name} (${current.email})` : current.email }), {},