From e7de274721cc2516c20ec0db3f2b76f7b5bc487f Mon Sep 17 00:00:00 2001
From: Arkerthan <arkerthan@gmail.com>
Date: Sun, 24 Oct 2021 15:24:54 +0200
Subject: [PATCH] Fix applying diff when the base value is null

---
 js/diff.js | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/js/diff.js b/js/diff.js
index 1c14acca969..f05f9082958 100644
--- a/js/diff.js
+++ b/js/diff.js
@@ -175,12 +175,10 @@ App.Utils.Diff = (function() {
 				base[key] = value;
 			} else if (_.isArray(value)) {
 				base[key] = value;
+			} else if (base[key] === undefined || base[key] === null) {
+				base[key] = value;
 			} else {
-				if (base[key] !== undefined) {
-					applyDiff(base[key], value);
-				} else {
-					base[key] = value;
-				}
+				applyDiff(base[key], value);
 			}
 		}
 	}
-- 
GitLab