Skip to content

Commit

Permalink
Fix crash in MainDetails component on Replica edit.
Browse files Browse the repository at this point in the history
When editing a Replica while looking at its MainDetails screen and
changing a value, the MainDetails page in the background
automatically re-renders on each value selection, and crashed if the
value was edited to be null.

Signed-off-by: Nashwan Azhari <[email protected]>
  • Loading branch information
aznashwan committed May 31, 2024
1 parent 59d7541 commit 6e7a634
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,9 @@ class MainDetails extends React.Component<Props, State> {
if (p === "disk_mappings" || p === "backend_mappings") {
return null;
}
if (value[p] == null || value[p] == undefined) {
return null;
}
return {
label: `${label} - ${LabelDictionary.get(p)}`,
value: getValue(p, value[p]),
Expand Down

0 comments on commit 6e7a634

Please sign in to comment.