Kaynağa Gözat

Fix reset to null in Edit Replica modal

Fixes an issue in the 'Edit Replica' modal where setting a field's value
to 'null' could cause the client to send an invalid value to the API.
Sergiu Miclea 2 yıl önce
ebeveyn
işleme
c0b471a161
1 değiştirilmiş dosya ile 1 ekleme ve 1 silme
  1. 1 1
      src/plugins/default/OptionsSchemaPlugin.ts

+ 1 - 1
src/plugins/default/OptionsSchemaPlugin.ts

@@ -153,7 +153,7 @@ export const defaultGetDestinationEnv = (
     }
     if (Array.isArray(value)) {
       env[optionName] = value;
-    } else if (typeof value === "object") {
+    } else if (typeof value === "object" && value != null) {
       const oldValue = oldOptions?.[optionName] || {};
       const mergedValue: any = { ...oldValue, ...value };
       const newValue: any = {};