From 043ed4538f5bdc16d299bc40c2dd8285a3120f9b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Hannu=20Niemist=C3=B6?= Date: Mon, 29 May 2017 12:15:18 +0300 Subject: [PATCH] (refs #7242) Fixed NPE in SCLModuleTree A null input must be handled when the component is disposed. Change-Id: I915c68aa3d15b4d5a3cbd89220bd3701f262fee1 --- .../org/simantics/scl/ui/modulebrowser/SCLModuleTree.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bundles/org.simantics.scl.ui/src/org/simantics/scl/ui/modulebrowser/SCLModuleTree.java b/bundles/org.simantics.scl.ui/src/org/simantics/scl/ui/modulebrowser/SCLModuleTree.java index 6ce186f2f..acaffd0f5 100644 --- a/bundles/org.simantics.scl.ui/src/org/simantics/scl/ui/modulebrowser/SCLModuleTree.java +++ b/bundles/org.simantics.scl.ui/src/org/simantics/scl/ui/modulebrowser/SCLModuleTree.java @@ -23,11 +23,14 @@ public class SCLModuleTree extends TreeViewer { @Override public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { - this.rootEntry = createModuleTreeEntry((Collection)newInput); + if(newInput != null) + this.rootEntry = createModuleTreeEntry((Collection)newInput); } @Override public Object[] getElements(Object inputElement) { + if(rootEntry == null) + return new Object[0]; return rootEntry.children().toArray(); } -- 2.47.1