From d17abd3f0bb52f0338529cf19630b911626e6a89 Mon Sep 17 00:00:00 2001 From: Carmine DiMascio Date: Wed, 6 Jan 2021 08:54:38 -0500 Subject: [PATCH] fix: preprocessor type of undefined --- src/middlewares/parsers/schema.preprocessor.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/middlewares/parsers/schema.preprocessor.ts b/src/middlewares/parsers/schema.preprocessor.ts index ab557617..ba8cd9e3 100644 --- a/src/middlewares/parsers/schema.preprocessor.ts +++ b/src/middlewares/parsers/schema.preprocessor.ts @@ -249,9 +249,11 @@ export class SchemaPreprocessor { const options = opts[kind]; options.path = node.path; - this.handleSerDes(pschema, nschema, options); - this.handleReadonly(pschema, nschema, options); - this.processDiscriminator(pschema, nschema, options); + if (nschema) { + this.handleSerDes(pschema, nschema, options); + this.handleReadonly(pschema, nschema, options); + this.processDiscriminator(pschema, nschema, options); + } } }