mikolalysenko / patcher.js

JSON diffing and patching library
Other
113 stars 7 forks source link

guard against next[id] as null #5

Closed ghost closed 10 years ago

ghost commented 10 years ago

I was getting this error because sometimes next[id] is null, but typeof null === 'object':

/home/substack/projects/enliven/node_modules/patcher/index.js:155
        if(next[id].equals !== undefined && next[id].equals(prev[id])) {
                   ^
TypeError: Cannot read property 'equals' of null
mikolalysenko commented 10 years ago

Thanks!