From: Jim Procter Date: Wed, 11 Feb 2015 09:19:55 +0000 (+0000) Subject: JAL-845 avoid OOBException when method is called with only one view X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=e2bf8bf31acb32852fc7ded8706d35f16698b07f;p=jalview.git JAL-845 avoid OOBException when method is called with only one view --- 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));