JAL-3063 correct handling of absent choice element in DBRef Mapping
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Wed, 23 Jan 2019 09:15:52 +0000 (09:15 +0000)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Wed, 23 Jan 2019 09:15:52 +0000 (09:15 +0000)
src/jalview/project/Jalview2XML.java

index 74b6bf0..e57dd01 100644 (file)
@@ -5829,15 +5829,16 @@ public class Jalview2XML
     jalview.datamodel.Mapping jmap = new jalview.datamodel.Mapping(dsto, fr,
             fto, m.getMapFromUnit().intValue(),
             m.getMapToUnit().intValue());
-    // if (m.getMappingChoice() != null)
-    // {
-    // MappingChoice mc = m.getMappingChoice();
+
+    /*
+     * (optional) choice of dseqFor or Sequence
+     */
     if (m.getDseqFor() != null)
     {
       String dsfor = m.getDseqFor();
       if (seqRefIds.containsKey(dsfor))
       {
-        /**
+        /*
          * recover from hash
          */
         jmap.setTo(seqRefIds.get(dsfor));
@@ -5847,9 +5848,9 @@ public class Jalview2XML
         frefedSequence.add(newMappingRef(dsfor, jmap));
       }
     }
-    else
+    else if (m.getSequence() != null)
     {
-      /**
+      /*
        * local sequence definition
        */
       Sequence ms = m.getSequence();