소스 검색

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 <nazhari@cloudbasesolutions.com>
Nashwan Azhari 2 년 전
부모
커밋
6e7a6345a6
1개의 변경된 파일3개의 추가작업 그리고 0개의 파일을 삭제
  1. 3 0
      src/components/modules/TransferModule/MainDetails/MainDetails.tsx

+ 3 - 0
src/components/modules/TransferModule/MainDetails/MainDetails.tsx

@@ -261,6 +261,9 @@ class MainDetails extends React.Component<Props, State> {
             if (p === "disk_mappings" || p === "backend_mappings") {
             if (p === "disk_mappings" || p === "backend_mappings") {
               return null;
               return null;
             }
             }
+            if (value[p] == null || value[p] == undefined) {
+              return null;
+            }
             return {
             return {
               label: `${label} - ${LabelDictionary.get(p)}`,
               label: `${label} - ${LabelDictionary.get(p)}`,
               value: getValue(p, value[p]),
               value: getValue(p, value[p]),