diff options
author | Markus Schorn | 2014-08-28 11:38:17 +0000 |
---|---|---|
committer | Markus Schorn | 2014-08-28 11:44:36 +0000 |
commit | 4fac47d2ea0b0aeb6fa882f24dece7c6fc948eb4 (patch) | |
tree | 03d9226dfae988892ad2a7816c10039dcf077f5c | |
parent | 98e2f01a972e41e5530690a73be57b08a04e8338 (diff) | |
download | org.eclipse.cdt-4fac47d2ea0b0aeb6fa882f24dece7c6fc948eb4.tar.gz org.eclipse.cdt-4fac47d2ea0b0aeb6fa882f24dece7c6fc948eb4.tar.xz org.eclipse.cdt-4fac47d2ea0b0aeb6fa882f24dece7c6fc948eb4.zip |
Bug 440057: Fix ClassCastException invoking C/C++ Project Settings Import Wizard.
-rw-r--r-- | core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/settingswizards/ProjectSettingsWizard.java | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/settingswizards/ProjectSettingsWizard.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/settingswizards/ProjectSettingsWizard.java index 5b8efe114de..439c2cf3435 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/settingswizards/ProjectSettingsWizard.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/settingswizards/ProjectSettingsWizard.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2009 IBM Corporation and others. + * Copyright (c) 2008, 2014 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -35,8 +35,10 @@ public abstract class ProjectSettingsWizard extends Wizard { // happens if the user invoked the wizard by right clicking on a project element if(selection != null) { - IProject project = (IProject)selection.getFirstElement(); - mainPage.setInitialProject(project); + final Object firstElement = selection.getFirstElement(); + if (firstElement instanceof IProject) { + mainPage.setInitialProject((IProject)firstElement); + } } addPage(mainPage); |