Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Vosburgh2016-07-28 15:50:01 -0400
committerBrian Vosburgh2016-07-28 15:51:00 -0400
commita427ff3de02ed18519fbb0f1b1400581b2a7123e (patch)
tree6c6730287bd4002b715eeca362fd2196c497ce33
parent5005859beaec512a193157882ecf6a6c3b8b4781 (diff)
downloadwebtools.dali-R3_6_maintenance.tar.gz
webtools.dali-R3_6_maintenance.tar.xz
webtools.dali-R3_6_maintenance.zip
[460406] add null check for unexpected Project Explorer elementR3_6_maintenance
-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