Permalink
Browse files

Guard against null when detecting object.

  • Loading branch information...
1 parent 229c9d9 commit 35aa0df6fd6a2cd380da97a7d442a97f5aedbb71 @papandreou papandreou committed Jul 19, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 index.js
View
@@ -186,7 +186,7 @@ function difflet (opts, prev, next) {
}
else if (typeof node == 'object') {
var insertedKey = false;
- var deleted = insertable && typeof prevNode === 'object'
+ var deleted = insertable && typeof prevNode === 'object' && prevNode !== null
? Object.keys(prevNode).filter(function (key) {
return !Object.hasOwnProperty.call(node, key);
})

0 comments on commit 35aa0df

Please sign in to comment.