Skip to content

Commit

Permalink
fix(GetTargetClusterUsageEx): Response "reduce" not handling undefine…
Browse files Browse the repository at this point in the history
…d correctly

Fixes #3252

Signed-off-by: Gordon Smith <gordonjsmith@gmail.com>
  • Loading branch information
GordonSmith committed May 13, 2019
1 parent 82c18c0 commit fc7ee15
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/comms/src/services/wsMachine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ export class MachineService {
Name: cu.Name,
Description: cu.Description,
MachineUsages,
MachineUsagesDescription: MachineUsages.reduce((prev, mu) => prev + mu.Description, ""),
MachineUsagesDescription: MachineUsages.reduce((prev, mu) => prev + (mu.Description || ""), ""),
mean: d3Mean(MachineUsages, mu => mu.mean),
max: d3Max(MachineUsages, mu => mu.max)
};
Expand All @@ -351,7 +351,7 @@ export class MachineService {
Name: tcu.Name,
Description: tcu.Description,
ComponentUsages,
ComponentUsagesDescription: ComponentUsages.reduce((prev, cu) => prev + cu.MachineUsagesDescription, ""),
ComponentUsagesDescription: ComponentUsages.reduce((prev, cu) => prev + (cu.MachineUsagesDescription || ""), ""),
mean: d3Mean(ComponentUsages, cu => cu.mean),
max: d3Max(ComponentUsages, cu => cu.max)
};
Expand Down

0 comments on commit fc7ee15

Please sign in to comment.