diff --git a/core/ast/src/main/java/org/overture/ast/factory/AstFactory.java b/core/ast/src/main/java/org/overture/ast/factory/AstFactory.java
index <HASH>..<HASH> 100644
--- a/core/ast/src/main/java/org/overture/ast/factory/AstFactory.java
+++ b/core/ast/src/main/java/org/overture/ast/factory/AstFactory.java
@@ -455,12 +455,15 @@ public class AstFactory {
 		result.setInvType(type);
 		result.setInvPattern(invPattern);
 		result.setInvExpression(invExpression);
-		
-		if(type.getDefinitions() == null)
-			type.setDefinitions(new LinkedList<PDefinition>());
-		
-		type.getDefinitions().add(result);
-		
+
+		if (type != null)
+		{
+			if (type.getDefinitions() == null)
+			{
+				type.setDefinitions(new LinkedList<PDefinition>());
+			}
+			type.getDefinitions().add(result);
+		}
 		return result;
 		
 	}
fixed possible null pointer introduced in commit #b<I>f<I>e<I>fd<I>b<I>e0a<I>e0c<I>c5d