JAL-1831 updated json schema doc
[jalview.git] / src / jalview / io / AppletFormatAdapter.java
index 90400f4..7dc263b 100755 (executable)
@@ -29,6 +29,7 @@ import jalview.datamodel.AlignmentView;
 import jalview.util.MessageManager;
 
 import java.io.File;
+import java.io.IOException;
 import java.io.InputStream;
 import java.util.List;
 
@@ -205,6 +206,10 @@ public class AppletFormatAdapter
   public static final boolean isValidFormat(String format,
           boolean forwriting)
   {
+    if (format == null)
+    {
+      return false;
+    }
     boolean valid = false;
     String[] format_list = (forwriting) ? WRITEABLE_FORMATS
             : READABLE_FORMATS;
@@ -339,7 +344,10 @@ public class AppletFormatAdapter
           ex.printStackTrace();
         }
       }
-
+      if (format.equalsIgnoreCase("HTML"))
+      {
+        throw new IOException(e.getMessage());
+      }
       // If we get to this stage, the format was not supported
       throw new java.io.IOException(SUPPORTED_FORMATS);
     }