Skip to content

Commit 83c6d5b

Browse files
committed
Fix assignment to undefined dicts
1 parent 7c83618 commit 83c6d5b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

js/src/_base/Three.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -650,6 +650,13 @@ var ThreeModel = widgets.WidgetModel.extend({
650650
// If instance equality, do nothing.
651651
return;
652652
}
653+
if (obj[key] === undefined || obj[key] === null) {
654+
if (value === null || value === undefined) {
655+
// Leave it as it is
656+
return;
657+
}
658+
obj[key] = {};
659+
}
653660
// Clear the dict
654661
Object.keys(obj[key]).forEach(k => { delete obj[key][k]; });
655662
// Put in the new values

0 commit comments

Comments
 (0)