Merge "Ensure GetElementClassRequest is not constructed without elementFactory"
authorTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Wed, 28 Dec 2016 14:52:39 +0000 (16:52 +0200)
committerGerrit Code Review <gerrit2@www.simantics.org>
Wed, 28 Dec 2016 14:52:39 +0000 (16:52 +0200)
bundles/org.simantics.diagram/src/org/simantics/diagram/adapter/GetElementClassRequest.java

index b23de4b345d7e7460e7bca3ef2f437a2e70ec457..17131efd14e2eb0d3647571d64f287b14d5c4b9d 100644 (file)
@@ -33,6 +33,8 @@ class GetElementClassRequest extends BinaryAsyncRead<Resource, ICanvasContext, E
 \r
     public GetElementClassRequest(ElementFactory elementFactory, Resource element, ICanvasContext canvas, IDiagram diagram) {\r
         super(element, canvas);\r
+        if (elementFactory == null)\r
+            throw new IllegalArgumentException("elementFactory == null for " + element + " in diagram " + diagram + " with context " + canvas);\r
         this.elementFactory = elementFactory; \r
         this.diagram = diagram;\r
     }\r