From e5047682d2f0559753a63d19078b77ee751071e7 Mon Sep 17 00:00:00 2001 From: Pascal Muetschard Date: Tue, 17 Oct 2017 14:18:57 -0700 Subject: [PATCH] Fix an index out of bounds exception if the tree is empty. Fixes #1154 --- gapic/src/main/com/google/gapid/widgets/LinkifiedTree.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gapic/src/main/com/google/gapid/widgets/LinkifiedTree.java b/gapic/src/main/com/google/gapid/widgets/LinkifiedTree.java index 7b71314b8a..293f8e4eeb 100644 --- a/gapic/src/main/com/google/gapid/widgets/LinkifiedTree.java +++ b/gapic/src/main/com/google/gapid/widgets/LinkifiedTree.java @@ -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(); }