Skip to content

Commit

Permalink
fix: check if data exists
Browse files Browse the repository at this point in the history
  • Loading branch information
mdonnalley committed Sep 13, 2021
1 parent 9a15d58 commit 93532af
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/hooks/envDisplay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const hook: SfHook.EnvDisplay<OrgAuthorization> = async function (opts) {
const orgs = await AuthInfo.listAllAuthorizations();
const data =
orgs.find((org) => org.username === opts.targetEnv) ?? orgs.find((org) => org.aliases?.includes(opts.targetEnv));
delete data['timestamp'];
if (data) delete data['timestamp'];
return {
data,
keys: { orgId: 'Org ID', oauthMethod: 'Auth Method' },
Expand Down

0 comments on commit 93532af

Please sign in to comment.