diff --git a/src/docgen/generator.js b/src/docgen/generator.js
index <HASH>..<HASH> 100644
--- a/src/docgen/generator.js
+++ b/src/docgen/generator.js
@@ -14,9 +14,9 @@ export default class Generator {
 
   isType(type) {
     const cleanedType = this.cleanType(type);
-    return !!(this.service.models.find((m) => m.name === cleanedType)
-      || this.service.enums.find((m) => m.name === cleanedType)
-      || this.service.unions.find((m) => m.name === cleanedType));
+    return !!(this.service.models && this.service.models.find((m) => m.name === cleanedType)
+      || this.service.enums && this.service.enums.find((m) => m.name === cleanedType)
+      || this.service.unions && this.service.unions.find((m) => m.name === cleanedType));
   }
 
   linkType(type) {
Avoid TypeError by not reading properties in undefined objects