Skip to main content

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

Thanks for pointing this out, I have move this check into the isValid method
as it will reflect that there is no selected debugger in the UI.

Question: what were the steps in reproducing this.

Don Howard wrote:

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);








Back to the top