Skip to content

Commit aaac434

Browse files
committed
fix: add safeguard for undefined
closes #236
1 parent 6aa3a7d commit aaac434

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/utils/spec-manager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ export class SpecManager {
189189
// check if parent definition name is in the enum of possible values
190190
if (definition.discriminator) {
191191
let prop = definition.properties[definition.discriminator];
192-
if (prop.enum && prop.enum.indexOf(JsonPointer.baseName(defPointer)) > -1) {
192+
if (prop && prop.enum && prop.enum.indexOf(JsonPointer.baseName(defPointer)) > -1) {
193193
res.push({
194194
name: JsonPointer.baseName(defPointer),
195195
$ref: defPointer

0 commit comments

Comments
 (0)