Skip to content

Commit

Permalink
fix(switch): fix switch command error when no user logged in (#3851)
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasholzer authored Dec 17, 2021
1 parent 53defb3 commit 74cc879
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/commands/switch/switch.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 }),
{},
Expand Down

1 comment on commit 74cc879

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📊 Benchmark results

Package size: 358 MB

Please sign in to comment.