From 6e7a6345a6bcfa1d3efca9e17911943d58f6db72 Mon Sep 17 00:00:00 2001 From: Nashwan Azhari Date: Wed, 29 May 2024 21:17:45 +0300 Subject: [PATCH] Fix crash in MainDetails component on Replica edit. 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 --- .../modules/TransferModule/MainDetails/MainDetails.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/components/modules/TransferModule/MainDetails/MainDetails.tsx b/src/components/modules/TransferModule/MainDetails/MainDetails.tsx index a1210b54..3d476639 100644 --- a/src/components/modules/TransferModule/MainDetails/MainDetails.tsx +++ b/src/components/modules/TransferModule/MainDetails/MainDetails.tsx @@ -261,6 +261,9 @@ class MainDetails extends React.Component { 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]),