Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Vosburgh2016-07-28 15:50:01 -0400
committerBrian Vosburgh2017-05-17 16:36:11 -0400
commit6e77c46aaa51b524ad4b815acb1358bd25c4e0ba (patch)
treeb42445b9417f470389ace449a4e1dccc44f4b321
parent5d0b6143a28738fbbb1be563d75741bd1436ca80 (diff)
downloadwebtools.dali-6e77c46aaa51b524ad4b815acb1358bd25c4e0ba.tar.gz
webtools.dali-6e77c46aaa51b524ad4b815acb1358bd25c4e0ba.tar.xz
webtools.dali-6e77c46aaa51b524ad4b815acb1358bd25c4e0ba.zip
[460406] add null check for unexpected Project Explorer element
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/ItemTreeStateProviderManager.java12
1 files changed, 11 insertions, 1 deletions
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/ItemTreeStateProviderManager.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/ItemTreeStateProviderManager.java
index 2236edc0da..a2d061c7b0 100644
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/ItemTreeStateProviderManager.java
+++ b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/jface/ItemTreeStateProviderManager.java
@@ -18,6 +18,7 @@ import org.eclipse.jpt.common.ui.jface.ItemTreeContentProvider;
import org.eclipse.jpt.common.ui.jface.TreeStateProvider;
import org.eclipse.jpt.common.utility.exception.ExceptionHandler;
import org.eclipse.jpt.common.utility.internal.ArrayTools;
+import org.eclipse.jpt.common.utility.internal.ObjectTools;
import com.ibm.icu.text.MessageFormat;
/**
@@ -71,7 +72,16 @@ public class ItemTreeStateProviderManager
}
public Object[] getChildren(Object parentElement) {
- return this.getItemContentProvider(parentElement).getChildren();
+ ItemTreeContentProvider provider = this.getItemContentProvider(parentElement);
+ if (provider == null) { // 460406
+ if (PLUG_IN != null) {
+ String msg = MessageFormat.format("Unexpected parent: {0}", parentElement); //$NON-NLS-1$
+ IllegalArgumentException ex = new IllegalArgumentException(msg);
+ PLUG_IN.logError(ex);
+ }
+ return ObjectTools.EMPTY_OBJECT_ARRAY;
+ }
+ return provider.getChildren();
}
/**

Back to the top