diff --git a/extensions/resource-deployment/src/ui/radioGroupLoadingComponentBuilder.ts b/extensions/resource-deployment/src/ui/radioGroupLoadingComponentBuilder.ts index 766ebf5d4f..444369762a 100644 --- a/extensions/resource-deployment/src/ui/radioGroupLoadingComponentBuilder.ts +++ b/extensions/resource-deployment/src/ui/radioGroupLoadingComponentBuilder.ts @@ -46,12 +46,10 @@ export class RadioGroupLoadingComponentBuilder implements azdata.ComponentBuilde let options: (string[] | azdata.CategoryValue[]) = optionsInfo.values!; let defaultValue: string | ResourceTypeOptionValue = optionsInfo.defaultValue!; - if (optionsInfo.defaultValue) { - if ((optionsInfo.defaultValue).displayName) { - defaultValue = (optionsInfo.defaultValue).displayName; - } else { - defaultValue = optionsInfo.defaultValue; - } + if (typeof optionsInfo.defaultValue === 'string') { + defaultValue = optionsInfo.defaultValue; + } else { + defaultValue = optionsInfo.defaultValue.displayName; } options.forEach((op: string | azdata.CategoryValue) => { const option: azdata.CategoryValue = (typeof op === 'string')