Skip to content

Commit

Permalink
Merge pull request #18 from epoberezkin/master
Browse files Browse the repository at this point in the history
fix error: Cannot use 'in' operator to search for 'property' in 'value'
  • Loading branch information
manuelstofer committed Feb 17, 2016
2 parents c30e2f6 + 645e7da commit af007da
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ api.get = function get (obj, pointer) {
refTokens = api.parse(pointer);
while (refTokens.length) {
tok = refTokens.shift();
if (!(tok in obj)) {
if (!(typeof obj == 'object' && tok in obj)) {
throw new Error('Invalid reference token: ' + tok);
}
obj = obj[tok];
Expand Down

0 comments on commit af007da

Please sign in to comment.