summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorMarkus Keller2011-03-02 11:52:50 (EST)
committer Dani Megert2011-10-06 04:14:10 (EDT)
commitcd64094b5e4cb4fd5aa6df93cf45bcb3df949e9c (patch)
treeed8fc3c9a855fb8279cbe318c9f68b45f12fc27b
parenteab9e01d0609234b09f6b52ef55ed1b67e4f75d9 (diff)
downloadeclipse.platform.ui-cd64094b5e4cb4fd5aa6df93cf45bcb3df949e9c.zip
eclipse.platform.ui-cd64094b5e4cb4fd5aa6df93cf45bcb3df949e9c.tar.gz
eclipse.platform.ui-cd64094b5e4cb4fd5aa6df93cf45bcb3df949e9c.tar.bz2
Bug 283820: [Contexts] NPE on Keys preference page in ContextModel.filterContexts
-rw-r--r--bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/keys/model/ContextModel.java15
1 files changed, 9 insertions, 6 deletions
diff --git a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/keys/model/ContextModel.java b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/keys/model/ContextModel.java
index ec0842a..50f038c 100644
--- a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/keys/model/ContextModel.java
+++ b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/keys/model/ContextModel.java
@@ -154,12 +154,15 @@ public class ContextModel extends CommonModel {
.get(iterator.next());
try {
- if (actionSets == false
- && (contextElement.getId().equalsIgnoreCase(
- CONTEXT_ID_ACTION_SETS) || ((Context) contextElement
- .getModelObject()).getParentId()
- .equalsIgnoreCase(CONTEXT_ID_ACTION_SETS))) {
- restoreContext = true;
+ if (actionSets == false) {
+ if (contextElement.getId().equalsIgnoreCase(CONTEXT_ID_ACTION_SETS)) {
+ restoreContext = true;
+ } else {
+ String parentId = ((Context) contextElement.getModelObject()).getParentId();
+ if (parentId != null && parentId.equalsIgnoreCase(CONTEXT_ID_ACTION_SETS)) {
+ restoreContext = true;
+ }
+ }
}
} catch (NotDefinedException e) {
// No parentId to check