Skip to content

Commit cf66f3f

Browse files
authoredFeb 26, 2024
fix(core): NPE check in validator (#1238)
1 parent 5b76e3b commit cf66f3f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎packages/core/src/utils/validator.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ export const ibmOpenapiValidator = async (specs: OpenAPIObject) => {
1717
spectral.setRuleset(ibmOpenapiRuleset);
1818
const { errors, warnings } = await spectral.run(specs);
1919

20-
if (warnings.length) {
20+
if (warnings && warnings.length) {
2121
ibmOpenapiValidatorWarnings(warnings);
2222
}
2323

24-
if (errors.length) {
24+
if (errors && errors.length) {
2525
ibmOpenapiValidatorErrors(errors);
2626
}
2727
};

0 commit comments

Comments
 (0)
Please sign in to comment.