diff --git a/core/modules/utils/utils.js b/core/modules/utils/utils.js index 3c4736ddf..bc32711e3 100644 --- a/core/modules/utils/utils.js +++ b/core/modules/utils/utils.js @@ -224,11 +224,13 @@ exports.extendDeepCopy = function(object,extendedProperties) { exports.deepFreeze = function deepFreeze(object) { var property, key; - Object.freeze(object); - for(key in object) { - property = object[key]; - if($tw.utils.hop(object,key) && (typeof property === "object") && !Object.isFrozen(property)) { - deepFreeze(property); + if(object) { + Object.freeze(object); + for(key in object) { + property = object[key]; + if($tw.utils.hop(object,key) && (typeof property === "object") && !Object.isFrozen(property)) { + deepFreeze(property); + } } } };