1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Fix ClassCastException.

This commit is contained in:
Alain Magloire 2003-09-09 19:22:54 +00:00
parent 8a3a52b54a
commit 9f964e420c

View file

@ -282,9 +282,10 @@ public class BuildConsoleView extends ViewPart implements ISelectionListener, IB
if (selection == null || !(selection instanceof IStructuredSelection)) { if (selection == null || !(selection instanceof IStructuredSelection)) {
return project; return project;
} }
try { IStructuredSelection ssel = (IStructuredSelection) selection;
IStructuredSelection ssel = (IStructuredSelection) selection; Object element = ssel.getFirstElement();
IAdaptable input = (IAdaptable) ssel.getFirstElement(); if (element instanceof IAdaptable) {
IAdaptable input = (IAdaptable) element;
if (input != null) { if (input != null) {
IResource resource = null; IResource resource = null;
if (input instanceof IResource) { if (input instanceof IResource) {
@ -296,7 +297,6 @@ public class BuildConsoleView extends ViewPart implements ISelectionListener, IB
project = resource.getProject(); project = resource.getProject();
} }
} }
} catch (ClassCastException e) {
} }
return project; return project;
} }