Skip to content

Commit

Permalink
fix: don't try to deepMerge read-only properties
Browse files Browse the repository at this point in the history
  • Loading branch information
Swiftb0y committed Jan 20, 2025
1 parent c327cf1 commit 3b16e7c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions res/controllers/common-controller-scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,10 @@ const deepMerge = function(target, source) {
target.push(...Object.values(objTarget));
} else if (isSimpleObject(target) && isSimpleObject(source)) {
Object.keys(source).forEach(key => {
// ensure the property is not read-only, if so skip it.
if (!Object.getOwnPropertyDescriptor(source, key).writable) {
return;
}
if (
Array.isArray(target[key]) && Array.isArray(source[key]) ||
isSimpleObject(target[key]) && isSimpleObject(source[key])
Expand Down

0 comments on commit 3b16e7c

Please sign in to comment.