Skip to content

Commit

Permalink
fix(libs): fix open api parsing
Browse files Browse the repository at this point in the history
Open API file having nulls in them (typically in example payloads) were throwing errors
  • Loading branch information
nfroidure committed Oct 25, 2021
1 parent 60e3b5f commit 166b4a4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/whook/src/libs/openapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export function collectRefs(
for (const item of node) {
seenRefs = collectRefs(rootNode, item, seenRefs);
}
} else if (typeof node === 'object') {
} else if (node !== null && typeof node === 'object') {
const keys = Object.keys(node);

if (typeof node.$ref === 'string' && !seenRefs.includes(node.$ref)) {
Expand Down

0 comments on commit 166b4a4

Please sign in to comment.