JAL-1759 merge from develop
[jalview.git] / src / jalview / io / FileLoader.java
index 18ab642..3aded05 100755 (executable)
@@ -22,6 +22,7 @@ package jalview.io;
 
 import jalview.api.ComplexAlignFile;
 import jalview.api.FeaturesDisplayedI;
+import jalview.bin.Jalview;
 import jalview.datamodel.AlignmentI;
 import jalview.datamodel.ColumnSelection;
 import jalview.datamodel.PDBEntry;
@@ -257,6 +258,21 @@ public class FileLoader implements Runnable
         {
           format = new IdentifyFile().Identify(file, protocol);
         }
+
+      }
+
+      if (format == null || format.equalsIgnoreCase("EMPTY DATA FILE"))
+      {
+        Desktop.instance.stopLoading();
+        System.err.println("The input file \"" + file
+                + "\" has no data content!");
+        if (!Jalview.isHeadlessMode())
+        {
+          JOptionPane.showMessageDialog(null, "The input file \""
+                  + file + "\" has no data content!", "Empty data file",
+                  JOptionPane.ERROR_MESSAGE);
+        }
+        return;
       }
       // TODO: cache any stream datasources as a temporary file (eg. PDBs
       // retrieved via URL)