From ce1ebcb5396e5ee8d302fdcd639f7716d84e1a04 Mon Sep 17 00:00:00 2001 From: Cristian Dominguez <6853656+cristiand391@users.noreply.github.com> Date: Wed, 25 Oct 2023 14:51:30 -0300 Subject: [PATCH] Update src/stateAggregator/accessors/aliasAccessor.ts Co-authored-by: Shane McLaughlin --- src/stateAggregator/accessors/aliasAccessor.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/stateAggregator/accessors/aliasAccessor.ts b/src/stateAggregator/accessors/aliasAccessor.ts index 112b5fe6a3..0a6653624b 100644 --- a/src/stateAggregator/accessors/aliasAccessor.ts +++ b/src/stateAggregator/accessors/aliasAccessor.ts @@ -281,11 +281,8 @@ const fileContentsRawToAliasStore = (contents: string): Map => { [DEFAULT_GROUP]: { [alias: string]: string }; }; - // old alias file may not have `orgs` prop - if (!fileContents[DEFAULT_GROUP]) { - fileContents[DEFAULT_GROUP] = {}; - } - return new Map(Object.entries(fileContents[DEFAULT_GROUP])); + // handle when alias file exists but is missing the org property + return new Map(Object.entries(fileContents[DEFAULT_GROUP] ?? {})); }; const aliasStoreToRawFileContents = (aliasStore: Map): string =>