diff --git a/compiler/TypeCheck.jrag b/compiler/TypeCheck.jrag
index a640ace5098013bef6cad31767a96220aa66b8a7..a61224b070c09cc8dcdba548c198011050255acb 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();