Fix NPEs.
authorryall
Tue, 04 Aug 2009 14:00:13 -0500
changeset 50 fcb77f9783d2
parent 49 e82f98a34bed
child 51 49c226a8748e
Fix NPEs.
cdt/cdt_6_0_x/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CMainTab.java
--- a/cdt/cdt_6_0_x/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CMainTab.java	Tue Aug 04 13:42:53 2009 -0500
+++ b/cdt/cdt_6_0_x/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CMainTab.java	Tue Aug 04 14:00:13 2009 -0500
@@ -493,13 +493,16 @@
 	}
 
 	protected void updateProgramFromConfig(ILaunchConfiguration config) {
-		String programName = EMPTY_STRING;
-		try {
-			programName = config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, EMPTY_STRING);
-		} catch (CoreException ce) {
-			LaunchUIPlugin.log(ce);
+		if (fProgText != null)
+		{
+			String programName = EMPTY_STRING;
+			try {
+				programName = config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, EMPTY_STRING);
+			} catch (CoreException ce) {
+				LaunchUIPlugin.log(ce);
+			}
+			fProgText.setText(programName);
 		}
-		fProgText.setText(programName);
 	}
 
 	/** @since 6.0 */
@@ -546,8 +549,12 @@
 			config.setMappedResources(null);
 		}
 		config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_NAME, fProjText.getText());
-		config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_BUILD_CONFIG_ID, (String)fBuildConfigCombo.getData(Integer.toString(fBuildConfigCombo.getSelectionIndex())));
-		config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, fProgText.getText());
+		if (fBuildConfigCombo != null) {
+			config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_BUILD_CONFIG_ID, (String)fBuildConfigCombo.getData(Integer.toString(fBuildConfigCombo.getSelectionIndex())));
+		}
+		if (fProgText != null) {
+			config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, fProgText.getText());
+		}
 		if (fCoreText != null) {
 			config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_COREFILE_PATH, fCoreText.getText());
 		}