Skip to content

Commit 74cc879

Browse files
author
Lukas Holzer
authored
fix(switch): fix switch command error when no user logged in (#3851)
1 parent 53defb3 commit 74cc879

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/commands/switch/switch.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const LOGIN_NEW = 'I would like to login to a new account'
1212
* @param {import('../base-command').BaseCommand} command
1313
*/
1414
const switchCommand = async (options, command) => {
15-
const availableUsersChoices = Object.values(command.netlify.globalConfig.get('users')).reduce(
15+
const availableUsersChoices = Object.values(command.netlify.globalConfig.get('users') || {}).reduce(
1616
(prev, current) =>
1717
Object.assign(prev, { [current.id]: current.name ? `${current.name} (${current.email})` : current.email }),
1818
{},

0 commit comments

Comments
 (0)