From: Marko Luukkainen Date: Mon, 23 May 2022 11:40:37 +0000 (+0300) Subject: DefaultPasteHandler causes NPE if copied data is missing X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=c87d7b88e303ba816a3317b9421559a5825e38d0;p=simantics%2Fplatform.git DefaultPasteHandler causes NPE if copied data is missing gitlab #844 Change-Id: If55b61c0890187212df3a0026880fbdc437a0e09 --- diff --git a/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/adapter/impl/DefaultPasteHandler.java b/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/adapter/impl/DefaultPasteHandler.java index 44aea9ad9..2f1ca6d1b 100644 --- a/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/adapter/impl/DefaultPasteHandler.java +++ b/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/adapter/impl/DefaultPasteHandler.java @@ -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);