diff options
author | Andrey Loskutov | 2017-01-30 09:59:52 +0000 |
---|---|---|
committer | Andrey Loskutov | 2017-01-31 10:45:15 +0000 |
commit | ce66e496c0c70046fc07dead768965f161dd8c56 (patch) | |
tree | b3a8078cbae5febd86dd0cb90812421ae474afdd /org.eclipse.debug.ui | |
parent | 659bcb13616ba5b4da6ef804e08152c0bda05a46 (diff) | |
download | eclipse.platform.debug-ce66e496c0c70046fc07dead768965f161dd8c56.tar.gz eclipse.platform.debug-ce66e496c0c70046fc07dead768965f161dd8c56.tar.xz eclipse.platform.debug-ce66e496c0c70046fc07dead768965f161dd8c56.zip |
Bug 499528 - Adding the IDebugContextProvider results inY20170202-1000I20170205-2000I20170204-2000I20170203-2000I20170202-2000I20170201-2000
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.java | 25 |
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; |