From de55078200c8f2e52f4784ed9aa6b1c6611ddb86 Mon Sep 17 00:00:00 2001 From: Katja Luther Date: Wed, 29 Aug 2018 12:23:06 +0200 Subject: [PATCH] fix #7371: fix NPE when deleting polytomous key --- .../handler/RemotingDeletePolytomousKeyHandlerE4.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/key/polytomous/e4/handler/RemotingDeletePolytomousKeyHandlerE4.java b/eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/key/polytomous/e4/handler/RemotingDeletePolytomousKeyHandlerE4.java index 0434e0c69..e3b64cbe8 100644 --- a/eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/key/polytomous/e4/handler/RemotingDeletePolytomousKeyHandlerE4.java +++ b/eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/key/polytomous/e4/handler/RemotingDeletePolytomousKeyHandlerE4.java @@ -80,10 +80,12 @@ public class RemotingDeletePolytomousKeyHandlerE4 extends RemotingCdmHandlerE4 { for (MPart part : parts) { if(part.getElementId().equals("eu.etaxonomy.taxeditor.editor.key.polytomous.e4.PolytomousKeyListEditorE4")){ PolytomousKeyListEditorE4 keyListEditor = (PolytomousKeyListEditorE4) part.getObject(); - UUID uuidForKey = keyListEditor.getEditorInput().getKey().getUuid(); - for (UUID keyUuid :keysToDelete) { - if(uuidForKey.equals(keyUuid)){ - partService.hidePart(part, true); + if (keyListEditor != null){ + UUID uuidForKey = keyListEditor.getEditorInput().getKey().getUuid(); + for (UUID keyUuid :keysToDelete) { + if(uuidForKey.equals(keyUuid)){ + partService.hidePart(part, true); + } } } } -- 2.34.1