From e2bf8bf31acb32852fc7ded8706d35f16698b07f Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Wed, 11 Feb 2015 09:19:55 +0000 Subject: [PATCH] JAL-845 avoid OOBException when method is called with only one view --- src/jalview/gui/AlignFrame.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/jalview/gui/AlignFrame.java b/src/jalview/gui/AlignFrame.java index 3ef56bf..6a42a65 100644 --- a/src/jalview/gui/AlignFrame.java +++ b/src/jalview/gui/AlignFrame.java @@ -5930,7 +5930,8 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, throw new Error(MessageManager.getString("error.implementation_error_cannot_show_view_alignment_frame")); } if (tabbedPane != null - & alignPanels.indexOf(alignmentPanel) != tabbedPane + && tabbedPane.getTabCount() > 0 + && alignPanels.indexOf(alignmentPanel) != tabbedPane .getSelectedIndex()) { tabbedPane.setSelectedIndex(alignPanels.indexOf(alignmentPanel)); -- 1.7.10.2