Skip to content

Commit ce16017

Browse files
committed
Update
1 parent 53de3bf commit ce16017

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/commands/image/updateImage/UpdateRegistryAndSecretsStep.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,11 @@ export class UpdateRegistryAndSecretsStep extends AzureWizardExecuteStep<UpdateI
5656
}
5757

5858
function sortAlphabeticallyByKey<T extends Secret | RegistryCredentials>(a: T, b: T, key: keyof T): number {
59-
const valOne = nonNullProp(a, key) as string;
60-
const valTwo = nonNullProp(b, key) as string;
59+
if (typeof a[key] !== 'string' || typeof b[key] !== 'string') {
60+
return 0;
61+
}
62+
63+
const valOne = a[key] as string;
64+
const valTwo = b[key] as string;
6165
return valOne.localeCompare(valTwo);
6266
}

0 commit comments

Comments
 (0)