🐛 Fix bug with null in ObservableObject

This commit is contained in:
Jan Oberhauser
2020-12-28 19:18:16 +01:00
parent 1d2c286b88
commit 50e16de270
2 changed files with 10 additions and 1 deletions

View File

@@ -13,7 +13,7 @@ export function create(target: IDataObject, parent?: IObservableObject, option?:
// Make all the children of target also observeable
for (const key in target) {
if (typeof target[key] === 'object') {
if (typeof target[key] === 'object' && target[key] !== null) {
target[key] = create(target[key] as IDataObject, (parent || target) as IObservableObject, option, depth + 1);
}
}