Skip to content

Commit 6af9a4c

Browse files
authored
Account for the fact that properties can be null (#4609)
1 parent a7ce155 commit 6af9a4c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/FunctionAppResolver.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,16 @@ export class FunctionAppResolver implements AppResourceResolver {
5858
});
5959

6060
const record = response.data as Record<string, FunctionQueryModel>;
61+
// seems as if properties can be null, so we need to check for that
6162
Object.values(record).forEach(data => {
6263
const dataModel: FunctionAppModel = {
63-
isFlex: data.properties.sku.toLocaleLowerCase() === 'flexconsumption',
64+
isFlex: data.properties?.sku?.toLocaleLowerCase() === 'flexconsumption',
6465
id: data.id,
6566
type: data.type,
6667
kind: data.kind,
6768
name: data.name,
6869
resourceGroup: data.resourceGroup,
69-
status: data.properties.state,
70+
status: data.properties?.state,
7071
location: data.location
7172
}
7273
resolver.siteCache.set(dataModel.id.toLowerCase(), dataModel);

0 commit comments

Comments
 (0)