Skip to content

Commit

Permalink
Fix an index out of bounds exception if the tree is empty.
Browse files Browse the repository at this point in the history
Fixes #1154
  • Loading branch information
pmuetschard committed Oct 17, 2017
1 parent 157c3c7 commit e504768
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gapic/src/main/com/google/gapid/widgets/LinkifiedTree.java
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ protected LabelProvider createLabelProvider(Theme theme) {

public void setInput(T root) {
viewer.setInput(root);
if (root != null) {
if (root != null && viewer.getTree().getItemCount() > 0) {
viewer.getTree().setSelection(viewer.getTree().getItem(0));
viewer.getTree().showSelection();
}
Expand Down

0 comments on commit e504768

Please sign in to comment.