The required resources field is not always present, leading the logical view to crash when it is not present. (#9959)

Co-authored-by: Max Fitton <max@semprehealth.com>
This commit is contained in:
Max Fitton
2020-08-06 12:59:52 -07:00
committed by SangBin Cho
parent 59a4c86497
commit 735cc40162
2 changed files with 2 additions and 1 deletions
+1 -1
View File
@@ -189,7 +189,7 @@ export type FullActorInfo = {
export type PartialActorInfo = {
actorId: string;
actorTitle: string;
requiredResources: { [key: string]: number };
requiredResources?: { [key: string]: number };
state: ActorState.Invalid;
invalidStateType?: InvalidStateType;
};
@@ -192,6 +192,7 @@ class Actor extends React.Component<Props & WithStyles<typeof styles>, State> {
{
label: "Required resources",
value:
actor.requiredResources &&
Object.entries(actor.requiredResources).length > 0 &&
Object.entries(actor.requiredResources)
.sort((a, b) => a[0].localeCompare(b[0]))