Skip to main content
summaryrefslogtreecommitdiffstats
path: root/launch
diff options
context:
space:
mode:
authorKen Ryall2009-05-13 02:51:26 -0400
committerKen Ryall2009-05-13 02:51:26 -0400
commit330bfbfa29b489b0ae2918aea43ce7e05e05bfed (patch)
tree5e0145d2c0c5f41fd9a29165a657962f035b8dca /launch
parent9f3c5eb0edf9fd70ab1795a9280e548adedc4704 (diff)
downloadorg.eclipse.cdt-330bfbfa29b489b0ae2918aea43ce7e05e05bfed.tar.gz
org.eclipse.cdt-330bfbfa29b489b0ae2918aea43ce7e05e05bfed.tar.xz
org.eclipse.cdt-330bfbfa29b489b0ae2918aea43ce7e05e05bfed.zip
Fix NPE.
Diffstat (limited to 'launch')
-rw-r--r--launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CMainTab.java49
1 files changed, 26 insertions, 23 deletions
diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CMainTab.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CMainTab.java
index a15462a449..b9dff1d42a 100644
--- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CMainTab.java
+++ b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CMainTab.java
@@ -217,31 +217,34 @@ public class CMainTab extends CLaunchConfigurationTab {
* @since 6.0
*/
protected void updateBuildConfigCombo(String selectedConfigID) {
- fBuildConfigCombo.removeAll();
- fBuildConfigCombo.add(LaunchMessages.getString("CMainTab.Use_Active")); //$NON-NLS-1$
- fBuildConfigCombo.setData("0", EMPTY_STRING); //$NON-NLS-1$
- fBuildConfigCombo.select(0);
- ICProject cproject = getCProject();
- if (cproject != null){
-
- ICProjectDescription projDes = CDTPropertyManager.getProjectDescription(cproject.getProject());
- if (projDes != null)
- {
- int selIndex = 0;
- ICConfigurationDescription[] configurations = projDes.getConfigurations();
- ICConfigurationDescription selectedConfig = projDes.getConfigurationById(selectedConfigID);
- for (int i = 0; i < configurations.length; i++) {
- String configName = configurations[i].getName();
- fBuildConfigCombo.add(configName);
- fBuildConfigCombo.setData(Integer.toString(i + 1), configurations[i].getId());
- if (selectedConfig != null && selectedConfigID.equals(configurations[i].getId()))
- selIndex = i + 1;
+ if (fBuildConfigCombo != null)
+ {
+ fBuildConfigCombo.removeAll();
+ fBuildConfigCombo.add(LaunchMessages.getString("CMainTab.Use_Active")); //$NON-NLS-1$
+ fBuildConfigCombo.setData("0", EMPTY_STRING); //$NON-NLS-1$
+ fBuildConfigCombo.select(0);
+ ICProject cproject = getCProject();
+ if (cproject != null){
+
+ ICProjectDescription projDes = CDTPropertyManager.getProjectDescription(cproject.getProject());
+ if (projDes != null)
+ {
+ int selIndex = 0;
+ ICConfigurationDescription[] configurations = projDes.getConfigurations();
+ ICConfigurationDescription selectedConfig = projDes.getConfigurationById(selectedConfigID);
+ for (int i = 0; i < configurations.length; i++) {
+ String configName = configurations[i].getName();
+ fBuildConfigCombo.add(configName);
+ fBuildConfigCombo.setData(Integer.toString(i + 1), configurations[i].getId());
+ if (selectedConfig != null && selectedConfigID.equals(configurations[i].getId()))
+ selIndex = i + 1;
+ }
+ fBuildConfigCombo.select(selIndex);
}
- fBuildConfigCombo.select(selIndex);
- }
- }
-
+ }
+
+ }
}
/**

Back to the top