mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Fix ClassCastException.
This commit is contained in:
parent
8a3a52b54a
commit
9f964e420c
1 changed files with 4 additions and 4 deletions
|
@ -282,9 +282,10 @@ public class BuildConsoleView extends ViewPart implements ISelectionListener, IB
|
|||
if (selection == null || !(selection instanceof IStructuredSelection)) {
|
||||
return project;
|
||||
}
|
||||
try {
|
||||
IStructuredSelection ssel = (IStructuredSelection) selection;
|
||||
IAdaptable input = (IAdaptable) ssel.getFirstElement();
|
||||
IStructuredSelection ssel = (IStructuredSelection) selection;
|
||||
Object element = ssel.getFirstElement();
|
||||
if (element instanceof IAdaptable) {
|
||||
IAdaptable input = (IAdaptable) element;
|
||||
if (input != null) {
|
||||
IResource resource = null;
|
||||
if (input instanceof IResource) {
|
||||
|
@ -296,7 +297,6 @@ public class BuildConsoleView extends ViewPart implements ISelectionListener, IB
|
|||
project = resource.getProject();
|
||||
}
|
||||
}
|
||||
} catch (ClassCastException e) {
|
||||
}
|
||||
return project;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue