Ensure GetElementClassRequest is not constructed without elementFactory 32/232/2
authorjsimomaa <jani.simomaa@gmail.com>
Wed, 28 Dec 2016 14:03:13 +0000 (16:03 +0200)
committerTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Wed, 28 Dec 2016 14:00:20 +0000 (17:00 +0300)
refs #6898

Change-Id: I905188f352bbaeae7787d817e7b0835a36138abf

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