Skip to content

Commit

Permalink
fix: add safeguard for undefined
Browse files Browse the repository at this point in the history
closes #236
  • Loading branch information
RomanHotsiy committed Mar 29, 2017
1 parent 6aa3a7d commit aaac434
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/utils/spec-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ export class SpecManager {
// check if parent definition name is in the enum of possible values
if (definition.discriminator) {
let prop = definition.properties[definition.discriminator];
if (prop.enum && prop.enum.indexOf(JsonPointer.baseName(defPointer)) > -1) {
if (prop && prop.enum && prop.enum.indexOf(JsonPointer.baseName(defPointer)) > -1) {
res.push({
name: JsonPointer.baseName(defPointer),
$ref: defPointer
Expand Down

0 comments on commit aaac434

Please sign in to comment.