Skip to content

Commit

Permalink
fix(core): NPE check in validator (orval-labs#1238)
Browse files Browse the repository at this point in the history
  • Loading branch information
melloware authored Feb 26, 2024
1 parent 5b76e3b commit cf66f3f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/core/src/utils/validator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ export const ibmOpenapiValidator = async (specs: OpenAPIObject) => {
spectral.setRuleset(ibmOpenapiRuleset);
const { errors, warnings } = await spectral.run(specs);

if (warnings.length) {
if (warnings && warnings.length) {
ibmOpenapiValidatorWarnings(warnings);
}

if (errors.length) {
if (errors && errors.length) {
ibmOpenapiValidatorErrors(errors);
}
};

0 comments on commit cf66f3f

Please sign in to comment.