Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-patch] CDebuggerTab buglet

I came across a null pointer exception while playing with the debugger 
configuration window.  CDebuggerTab::fCurrentDebugConfig is not not being 
initialized before it is used.  The patch below adds a check to avoid the 
exception, but I doubt that this is really enough to fix the problem.




Index: CDebuggerTab.java
===================================================================
RCS file: 
/home/tools/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CDebuggerTab.java,v
retrieving revision 1.9
diff -p -u -w -r1.9 CDebuggerTab.java
--- CDebuggerTab.java   29 Aug 2002 19:30:45 -0000      1.9
+++ CDebuggerTab.java   16 Sep 2002 23:09:31 -0000
@@ -241,7 +241,10 @@ public class CDebuggerTab extends CLaunc

        public void performApply(ILaunchConfigurationWorkingCopy config) {
                if (isValid(config)) {
-                       
config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_ID, 
getDebugConfig().getID());
+                       ICDebugConfiguration debugConfig = 
getDebugConfig();
+                       if (debugConfig != null) {
+                               
config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_ID, 
debugConfig.getID());
+                       }
                        ILaunchConfigurationTab dynamicTab = 
getDynamicTab();
                        if (dynamicTab == null) {
                                
config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_SPECIFIC_ATTRS_MAP, 
(Map) null);



-- 
dhoward@xxxxxxxxxx
gdb engineering






Back to the top