Skip to content

Commit

Permalink
patch object deep path find when current is null
Browse files Browse the repository at this point in the history
  • Loading branch information
roncodes committed Sep 1, 2021
1 parent 73e7f45 commit 179b102
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/utils/object.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ const get = (object, path) => {

if (isArray || isObject) {
for (let i = 0; i < pathArray.length; i++) {
if (current[pathArray[i]] === undefined) {
if (current && current[pathArray[i]] === undefined) {
return null;
} else {
} else if (current) {
current = current[pathArray[i]];

// if is resource then return get on it's attributes
Expand Down

0 comments on commit 179b102

Please sign in to comment.