From 6c0b422478bf23b1e10daf79e4219d6a24db5015 Mon Sep 17 00:00:00 2001 From: John Cortell Date: Wed, 25 Oct 2006 22:09:19 +0000 Subject: [PATCH] Fix for 162327: NPE when you hit Remove All Global Variables on an empty variables view. --- .../cdt/debug/internal/core/CGlobalVariableManager.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CGlobalVariableManager.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CGlobalVariableManager.java index fda22120cf3..0008922469f 100644 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CGlobalVariableManager.java +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CGlobalVariableManager.java @@ -136,6 +136,10 @@ public class CGlobalVariableManager implements ICGlobalVariableManager { * @see org.eclipse.cdt.debug.core.ICGlobalVariableManager#removeAllGlobals() */ public void removeAllGlobals() { + if (fGlobals == null ) { + return; + } + ICGlobalVariable[] globals = new ICGlobalVariable[0]; synchronized( fGlobals ) { globals = (ICGlobalVariable[])fGlobals.toArray( new ICGlobalVariable[fGlobals.size()] );