Skip to content

Commit

Permalink
merge the null fix
Browse files Browse the repository at this point in the history
  • Loading branch information
James Halliday committed Aug 30, 2013
2 parents 3f8d778 + d9f52fa commit c405df2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Traverse.prototype.get = function (ps) {
var node = this.value;
for (var i = 0; i < ps.length; i ++) {
var key = ps[i];
if (!hasOwnProperty.call(node, key)) {
if (!node || !hasOwnProperty.call(node, key)) {
node = undefined;
break;
}
Expand All @@ -23,7 +23,7 @@ Traverse.prototype.has = function (ps) {
var node = this.value;
for (var i = 0; i < ps.length; i ++) {
var key = ps[i];
if (!hasOwnProperty.call(node, key)) {
if (!node || !hasOwnProperty.call(node, key)) {
return false;
}
node = node[key];
Expand Down

0 comments on commit c405df2

Please sign in to comment.