mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-12 19:45:22 +02:00
null pointer check
This commit is contained in:
parent
1913bde373
commit
f6be2cde98
1 changed files with 5 additions and 4 deletions
|
@ -5954,12 +5954,13 @@ public class SystemView extends SafeTreeViewer
|
||||||
if (selection instanceof IStructuredSelection){
|
if (selection instanceof IStructuredSelection){
|
||||||
Object first = ((IStructuredSelection)selection).getFirstElement();
|
Object first = ((IStructuredSelection)selection).getFirstElement();
|
||||||
ISystemViewElementAdapter adapter = getViewAdapter(first);
|
ISystemViewElementAdapter adapter = getViewAdapter(first);
|
||||||
|
if (adapter != null){
|
||||||
Object parent = adapter.getParent(first);
|
Object parent = adapter.getParent(first);
|
||||||
if (parent != null){
|
if (parent != null){
|
||||||
parentSelection = new StructuredSelection(parent);
|
parentSelection = new StructuredSelection(parent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
SelectionChangedEvent dummyEvent = new SelectionChangedEvent(this, parentSelection);
|
SelectionChangedEvent dummyEvent = new SelectionChangedEvent(this, parentSelection);
|
||||||
SelectionChangedEvent event = new SelectionChangedEvent(this, selection);
|
SelectionChangedEvent event = new SelectionChangedEvent(this, selection);
|
||||||
|
|
Loading…
Add table
Reference in a new issue