mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-06 03:50:02 +02:00
GP-3047 - fixed potential npe due to a timing issue
This commit is contained in:
parent
3e03a86117
commit
5da5ec3b6d
1 changed files with 13 additions and 9 deletions
|
@ -104,6 +104,10 @@ public abstract class VisualGraphComponentProvider<V extends VisualVertex,
|
||||||
public Set<V> getSelectedVertices() {
|
public Set<V> getSelectedVertices() {
|
||||||
VisualGraphView<V, E, G> view = getView();
|
VisualGraphView<V, E, G> view = getView();
|
||||||
VisualizationViewer<V, E> viewer = view.getPrimaryGraphViewer();
|
VisualizationViewer<V, E> viewer = view.getPrimaryGraphViewer();
|
||||||
|
if (viewer == null) {
|
||||||
|
// we have seen this happen on some systems; timing issue?
|
||||||
|
return Collections.emptySet();
|
||||||
|
}
|
||||||
PickedState<V> pickedState = viewer.getPickedVertexState();
|
PickedState<V> pickedState = viewer.getPickedVertexState();
|
||||||
return pickedState.getPicked();
|
return pickedState.getPicked();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue