JAL-3619 default silently to Jmol if viewerType absent (Jalview < 2.9)
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Fri, 15 May 2020 16:48:57 +0000 (17:48 +0100)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Fri, 15 May 2020 16:48:57 +0000 (17:48 +0100)
src/jalview/project/Jalview2XML.java

index b6295d9..b408c07 100644 (file)
@@ -4403,9 +4403,14 @@ public class Jalview2XML
      * From 2.9: stateData.type contains JMOL or CHIMERA, data is in jar entry
      * "viewer_"+stateData.viewId
      */
-    ViewerType viewerType = ViewerType.valueOf(stateData.getType());
+    String type = stateData.getType();
+    if (type == null)
+    {
+      type = ViewerType.JMOL.toString();
+    }
     try
     {
+      ViewerType viewerType = ViewerType.valueOf(type);
       switch (viewerType)
       {
       case CHIMERA:
@@ -4423,7 +4428,7 @@ public class Jalview2XML
     } catch (IllegalArgumentException | NullPointerException e)
     {
       Cache.log.error(
-              "Invalid structure viewer type: " + stateData.getType());
+              "Invalid structure viewer type: " + type);
     }
   }