]> gerrit.simantics Code Review - simantics/platform.git/commitdiff
DefaultPasteHandler causes NPE if copied data is missing 14/4914/2
authorMarko Luukkainen <marko.luukkainen@semantum.fi>
Mon, 23 May 2022 11:40:37 +0000 (14:40 +0300)
committerMarko Luukkainen <marko.luukkainen@semantum.fi>
Tue, 24 May 2022 06:38:04 +0000 (06:38 +0000)
gitlab #844

Change-Id: If55b61c0890187212df3a0026880fbdc437a0e09

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

index 44aea9ad91a6d5f58db238b1c3a56469763e2713..2f1ca6d1b0fe1ed04247db0052840a584240f4bd 100644 (file)
@@ -163,7 +163,7 @@ public class DefaultPasteHandler extends PasteHandlerAdapter {
                result.addAll(pasteObject(graph, object, handler));
                if (cut != null)
                     cuts.addAll(cut);
-            } else {
+            } else if (cut != null) {
                Layer0 L0 = Layer0.getInstance(graph);
                for(Resource r : cut) {
                        graph.deny(r, L0.PartOf);