mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-22 06:02:11 +02:00
Bug 541709 Fix up exceptions when we can't find toolchains.
We weren't checking the case where the size of the toolchains array was zero. Return a null config in that case and fix up the CommonBuildTab to deal with that. Change-Id: Ibd8f659988f1463570bdb2654d6ea2b4a45866c2
This commit is contained in:
parent
62143e2bd7
commit
1a8b9a9628
2 changed files with 5 additions and 3 deletions
|
@ -157,6 +157,9 @@ public class MakeBuildSettingsTab extends CommonBuildTab {
|
||||||
super.initializeFrom(configuration);
|
super.initializeFrom(configuration);
|
||||||
|
|
||||||
ICBuildConfiguration buildConfig = getBuildConfiguration();
|
ICBuildConfiguration buildConfig = getBuildConfiguration();
|
||||||
|
if (buildConfig == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
String container = buildConfig.getProperty(StandardBuildConfiguration.BUILD_CONTAINER);
|
String container = buildConfig.getProperty(StandardBuildConfiguration.BUILD_CONTAINER);
|
||||||
if (container != null && !container.trim().isEmpty()) {
|
if (container != null && !container.trim().isEmpty()) {
|
||||||
IPath containerLoc = new Path(container);
|
IPath containerLoc = new Path(container);
|
||||||
|
|
|
@ -30,7 +30,6 @@ import org.eclipse.debug.ui.AbstractLaunchConfigurationTab;
|
||||||
import org.eclipse.debug.ui.ILaunchConfigurationDialog;
|
import org.eclipse.debug.ui.ILaunchConfigurationDialog;
|
||||||
import org.eclipse.launchbar.core.target.ILaunchTarget;
|
import org.eclipse.launchbar.core.target.ILaunchTarget;
|
||||||
import org.eclipse.launchbar.ui.ILaunchBarLaunchConfigDialog;
|
import org.eclipse.launchbar.ui.ILaunchBarLaunchConfigDialog;
|
||||||
import org.eclipse.launchbar.ui.internal.Activator;
|
|
||||||
import org.eclipse.swt.SWT;
|
import org.eclipse.swt.SWT;
|
||||||
import org.eclipse.swt.events.SelectionAdapter;
|
import org.eclipse.swt.events.SelectionAdapter;
|
||||||
import org.eclipse.swt.events.SelectionEvent;
|
import org.eclipse.swt.events.SelectionEvent;
|
||||||
|
@ -182,7 +181,7 @@ public abstract class CommonBuildTab extends AbstractLaunchConfigurationTab {
|
||||||
|
|
||||||
private boolean toolchainChanged() {
|
private boolean toolchainChanged() {
|
||||||
int i = tcCombo.getSelectionIndex();
|
int i = tcCombo.getSelectionIndex();
|
||||||
if (i < 0) {
|
if (i < 0 || toolchains.length == 0) {
|
||||||
buildConfig = null;
|
buildConfig = null;
|
||||||
return false;
|
return false;
|
||||||
} else if (i == 0) {
|
} else if (i == 0) {
|
||||||
|
@ -199,7 +198,7 @@ public abstract class CommonBuildTab extends AbstractLaunchConfigurationTab {
|
||||||
try {
|
try {
|
||||||
buildConfig = bcManager.getBuildConfiguration(project, newToolchain, mode, new NullProgressMonitor());
|
buildConfig = bcManager.getBuildConfiguration(project, newToolchain, mode, new NullProgressMonitor());
|
||||||
} catch (CoreException e) {
|
} catch (CoreException e) {
|
||||||
Activator.log(e.getStatus());
|
LaunchUIPlugin.log(e.getStatus());
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Add table
Reference in a new issue