Skip to content

Commit

Permalink
Fix bug that prevents resource groups from loading when there's a gho…
Browse files Browse the repository at this point in the history
…st resource (#820)

* Fix bug that prevents resource groups from loading when there's a ghost resource

* Update changelog
  • Loading branch information
alexweininger authored Feb 13, 2024
1 parent 3a9e91b commit 12ec0ee
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Change Log

## Unreleased

### Fixed
* [[820]](https://github.com/microsoft/vscode-azureresourcegroups/pull/820) Fix bug that prevents resource groups from loading when there's a ghost resource

## 0.8.4 - 2024-02-07

### Added
Expand Down
10 changes: 9 additions & 1 deletion src/tree/azure/grouping/AzureResourceGroupingManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,15 @@ function groupBy({ allResources, keySelector, initialGrouping, groupingItemFacto
},
initialGrouping);

return Object.entries(map).map(([key, resources]) => groupingItemFactory(key, resources));
const groupingItems: GroupingItem[] = [];
Object.entries(map).forEach(([key, resources]) => {
try {
groupingItems.push(groupingItemFactory(key, resources));
} catch (e) {
ext.outputChannel.error(`Error creating grouping item for key: "${key}"`, e);
}
});
return groupingItems;
}

export class AzureResourceGroupingManager extends vscode.Disposable {
Expand Down

0 comments on commit 12ec0ee

Please sign in to comment.