diff --git a/src/filters/nested.js b/src/filters/nested.js index 933cf740..fde73aac 100644 --- a/src/filters/nested.js +++ b/src/filters/nested.js @@ -50,9 +50,11 @@ var patchFilter = function nestedPatchFilter(context) { if (!context.nested) { return; } if (context.delta._t) { return; } var name, child; - for (name in context.delta) { - child = new PatchContext(context.left[name], context.delta[name]); - context.push(child, name); + if(context.left) { + for (name in context.delta) { + child = new PatchContext(context.left[name], context.delta[name]); + context.push(child, name); + } } context.exit(); }; @@ -106,4 +108,4 @@ exports.objectsDiffFilter = objectsDiffFilter; exports.patchFilter = patchFilter; exports.collectChildrenPatchFilter = collectChildrenPatchFilter; exports.reverseFilter = reverseFilter; -exports.collectChildrenReverseFilter = collectChildrenReverseFilter; \ No newline at end of file +exports.collectChildrenReverseFilter = collectChildrenReverseFilter;