Skip to content

Commit

Permalink
Add null checks when listing cache dependencies.
Browse files Browse the repository at this point in the history
  • Loading branch information
jgaehring committed Feb 13, 2023
1 parent e61e86c commit dfc617b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/field-kit/src/idb/cache.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ function listDependencies(name, entity) {
};
const field = entity?.relationships?.[relationship];
if (Array.isArray(field)) field.forEach(add);
if (field.id) add(field);
if (field?.id) add(field);
});
}
}
Expand All @@ -105,7 +105,7 @@ const unlistDependencies = name => (results) => {
};
const field = entity?.relationships?.[relationship];
if (Array.isArray(field)) field.forEach(remove);
if (field.id) remove(field);
if (field?.id) remove(field);
});
});
return results;
Expand Down

0 comments on commit dfc617b

Please sign in to comment.