JAL-845 avoid OOBException when method is called with only one view
authorJim Procter <jprocter@dundee.ac.uk>
Wed, 11 Feb 2015 09:19:55 +0000 (09:19 +0000)
committerJim Procter <jprocter@dundee.ac.uk>
Wed, 11 Feb 2015 09:19:55 +0000 (09:19 +0000)
src/jalview/gui/AlignFrame.java

index 3ef56bf..6a42a65 100644 (file)
@@ -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));