]> gerrit.simantics Code Review - simantics/platform.git/commitdiff
Check if root allows paste only for non-null target root to prevent NPE 13/2013/3
authorJussi Koskela <jussi.koskela@semantum.fi>
Mon, 20 Aug 2018 06:24:34 +0000 (09:24 +0300)
committerJussi Koskela <jussi.koskela@semantum.fi>
Mon, 20 Aug 2018 06:26:40 +0000 (06:26 +0000)
gitlab #84

Change-Id: I7d736e78928bc203bfb05e72af31e16d204bdc32

bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/adapter/impl/DefaultPasteHandler.java

index 067ed9207fe4d224f2add76b0ae00d71e098b51d..44aea9ad91a6d5f58db238b1c3a56469763e2713 100644 (file)
@@ -185,6 +185,8 @@ public class DefaultPasteHandler extends PasteHandlerAdapter {
     }
 
     protected void checkIfRootAllowsPaste(ReadGraph graph) throws DatabaseException {
+        if (resource == null)
+            return;
         Layer0 L0 = Layer0.getInstance(graph);
         // check if root is published
         Boolean published = graph.getPossibleRelatedValue(resource, L0.Entity_published);