Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrey Loskutov2017-01-30 09:59:52 +0000
committerAndrey Loskutov2017-01-31 10:45:15 +0000
commitce66e496c0c70046fc07dead768965f161dd8c56 (patch)
treeb3a8078cbae5febd86dd0cb90812421ae474afdd /org.eclipse.debug.ui
parent659bcb13616ba5b4da6ef804e08152c0bda05a46 (diff)
downloadeclipse.platform.debug-ce66e496c0c70046fc07dead768965f161dd8c56.tar.gz
eclipse.platform.debug-ce66e496c0c70046fc07dead768965f161dd8c56.tar.xz
eclipse.platform.debug-ce66e496c0c70046fc07dead768965f161dd8c56.zip
nullpointerException in DebugWindowContextService Change-Id: I98228b8ba15b4b2073bed446cd9b483da0c51763 Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
Diffstat (limited to 'org.eclipse.debug.ui')
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugWindowContextService.java25
1 files changed, 19 insertions, 6 deletions
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugWindowContextService.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugWindowContextService.java
index 6fea942e4..c02a87ede 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugWindowContextService.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugWindowContextService.java
@@ -247,8 +247,10 @@ public class DebugWindowContextService implements IDebugContextService, IPartLis
} else {
ListenerList<IDebugContextListener> listenerList = fListenersByPartId.get(null);
ListenerList<IDebugContextListener> retVal = new ListenerList<>();
- for (IDebugContextListener iDebugContextListener : listenerList) {
- retVal.add(iDebugContextListener);
+ if (listenerList != null) {
+ for (IDebugContextListener iDebugContextListener : listenerList) {
+ retVal.add(iDebugContextListener);
+ }
}
outer: for (Iterator<String> itr = fListenersByPartId.keySet().iterator(); itr.hasNext();) {
@@ -261,8 +263,12 @@ public class DebugWindowContextService implements IDebugContextService, IPartLis
continue outer;
}
}
- for (IDebugContextListener iDebugContextListener : fListenersByPartId.get(listenerPartId)) {
- retVal.add(iDebugContextListener); // no effect if listener already present
+ ListenerList<IDebugContextListener> listenersForPart = fListenersByPartId.get(listenerPartId);
+ if (listenersForPart != null) {
+ for (IDebugContextListener iDebugContextListener : listenersForPart) {
+ // no effect if listener already present
+ retVal.add(iDebugContextListener);
+ }
}
}
return retVal;
@@ -277,6 +283,9 @@ public class DebugWindowContextService implements IDebugContextService, IPartLis
return listenerList != null ? listenerList : new ListenerList<IDebugContextListener>();
} else {
ListenerList<IDebugContextListener> retVal = fPostListenersByPartId.get(null);
+ if (retVal == null) {
+ retVal = new ListenerList<IDebugContextListener>();
+ }
outer: for (Iterator<String> itr = fPostListenersByPartId.keySet().iterator(); itr.hasNext();) {
String listenerPartId = itr.next();
@@ -286,8 +295,12 @@ public class DebugWindowContextService implements IDebugContextService, IPartLis
continue outer;
}
}
- for (IDebugContextListener iDebugContextListener : fPostListenersByPartId.get(listenerPartId)) {
- retVal.add(iDebugContextListener); // no effect if listener already present
+ ListenerList<IDebugContextListener> listenersForPart = fPostListenersByPartId.get(listenerPartId);
+ if (listenersForPart != null) {
+ for (IDebugContextListener iDebugContextListener : listenersForPart) {
+ // no effect if listener already present
+ retVal.add(iDebugContextListener);
+ }
}
}
return retVal;

Back to the top