Skip to content

Commit

Permalink
Handle null references.
Browse files Browse the repository at this point in the history
  • Loading branch information
jimafisk committed Jan 3, 2023
1 parent 74c4ce3 commit 6e8987d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmd/defaults/ejected/cms/file_references.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const checkType = (value, file) => {
return true;
}
}
if (value.constructor === ({}).constructor) {
if (value && value.constructor === ({}).constructor) {
// It's an Obj, so go another layer deep
return findFile(value, file);
}
Expand All @@ -16,7 +16,7 @@ const checkType = (value, file) => {
const findFile = (fields, file) => {
let found = false;
for (const [key, value] of Object.entries(fields)) {
if (value.constructor === [].constructor) {
if (value && value.constructor === [].constructor) {
// It's an array, so loop through values
value.forEach(nestedVal => {
// Check the type of each value
Expand Down

0 comments on commit 6e8987d

Please sign in to comment.