diff --git a/lib/server-code/model/index.js b/lib/server-code/model/index.js
index <HASH>..<HASH> 100644
--- a/lib/server-code/model/index.js
+++ b/lib/server-code/model/index.js
@@ -92,7 +92,11 @@ class ServerCodeModel {
   }
 
   addError(error, serverCodeFile, erredFile) {
-    this.errors.push({ message: error.message || error, serverCodeFile, erredFile: erredFile.relativePath });
+    this.errors.push({
+      message  : error.message || error,
+      serverCodeFile,
+      erredFile: erredFile && erredFile.relativePath
+    });
   }
 
   get classMappings() {
fix (model) safe check for erredFile existence