JAL-2629 prevent hmmbuild from running if there are no sequences
authorTZVanaalten <TZVanaalten@LS30916.ad.lifesci.dundee.ac.uk>
Tue, 15 Aug 2017 16:30:47 +0000 (17:30 +0100)
committerTZVanaalten <TZVanaalten@LS30916.ad.lifesci.dundee.ac.uk>
Tue, 15 Aug 2017 16:30:47 +0000 (17:30 +0100)
src/jalview/hmmer/HMMBuildThread.java

index ed074a8..880ed0d 100644 (file)
@@ -58,7 +58,7 @@ public class HMMBuildThread implements Runnable
     if (alignment == null && group == null)
     {
       JOptionPane.showMessageDialog(af,
-              MessageManager.getString("label.no_sequence_data"));
+              MessageManager.getString("warn.no_sequence_data"));
       return;
     }
     try
@@ -92,7 +92,12 @@ public class HMMBuildThread implements Runnable
           }
           array = alignment.getSequencesArray();
         }
-
+        if (array.length < 1)
+        {
+          JOptionPane.showMessageDialog(af,
+                  MessageManager.getString("warn.no_sequence_data"));
+          return;
+        }
         SequenceI[] newArr = new SequenceI[array.length];
         int index = 0;
         for (SequenceI seq : array)