JAL-1668 added PDBDocFieldPreference for configuring rest response summary fields
[jalview.git] / src / jalview / analysis / AlignSeq.java
index 307a06f..2ef1c76 100755 (executable)
@@ -1153,9 +1153,10 @@ public class AlignSeq
               ap++;
             }
           }
-          if (sq.getAnnotation() != null)
+          if (sq.getAnnotation() != null && sq.getAnnotation().length > 0)
           {
-            annotations.addAll(inspos, Arrays.asList(sq.getAnnotation()));
+            annotations.addAll(inspos == -1 ? annotations.size() : inspos,
+                    Arrays.asList(sq.getAnnotation()));
           }
         }
       }