From d411973edc83056f40191f24f709e6dee73a325a Mon Sep 17 00:00:00 2001
From: Alfred Theorin <alfred.theorin@gmail.com>
Date: Thu, 24 Jul 2014 12:14:48 +0200
Subject: [PATCH] Fixed NullPointerException in compiler for specifications
 using undefined usertypes.

---
 compiler/TypeCheck.jrag | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/compiler/TypeCheck.jrag b/compiler/TypeCheck.jrag
index a640ace..a61224b 100644
--- a/compiler/TypeCheck.jrag
+++ b/compiler/TypeCheck.jrag
@@ -9,7 +9,13 @@ aspect TypeCheck {
   syn boolean Type.isNull();
   eq Type.isNull() = false;
   eq VoidType.isNull() = true;
-  eq UserType.isNull() = decl().isNull();
+  eq UserType.isNull()  {
+    if (decl() != null) {
+      return decl().isNull();
+    } else {
+      return false;
+    }
+  }
 
   syn boolean TypeDecl.isNull();
   eq TypeDecl.isNull() = getType().isNull();
-- 
GitLab