Skip to content

Commit

Permalink
Fix network logic (microsoft#2187)
Browse files Browse the repository at this point in the history
  • Loading branch information
bwateratmsft authored and Dmarch28 committed Mar 4, 2021
1 parent 632ce36 commit fc594f6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/tree/containers/ContainersTreeItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export class ContainersTreeItem extends LocalRootTreeItemBase<DockerContainer, C
}

public getPropertyValue(item: DockerContainer, property: ContainerProperty): string {
const networks = item.NetworkSettings?.Networks?.length > 0 ? Object.keys(item.NetworkSettings.Networks) : ['<none>'];
const networks = item.NetworkSettings?.Networks && Object.keys(item.NetworkSettings.Networks).length > 0 ? Object.keys(item.NetworkSettings.Networks) : ['<none>'];
const ports = item.Ports?.length > 0 ? item.Ports.map(p => p.PublicPort) : ['<none>'];

switch (property) {
Expand Down

0 comments on commit fc594f6

Please sign in to comment.