JAL-715 - prevent empty elements being generated
authorjprocter <jprocter@compbio.dundee.ac.uk>
Thu, 25 Aug 2011 09:24:27 +0000 (10:24 +0100)
committerjprocter <jprocter@compbio.dundee.ac.uk>
Thu, 25 Aug 2011 09:24:27 +0000 (10:24 +0100)
src/jalview/ws/rest/RestServiceDescription.java

index fe1434c..db35a2b 100644 (file)
@@ -384,7 +384,7 @@ public class RestServiceDescription
     String lstitem = null;
     while ((pos = list.indexOf(separator, cp)) >= cp)
     {
-      escape = (list.charAt(pos - 1) == '\\') ? -1 : 0;
+      escape = (pos>0 && list.charAt(pos - 1) == '\\') ? -1 : 0;
       if (wasescaped)
       {
         // append to previous pos
@@ -455,7 +455,7 @@ public class RestServiceDescription
       {
         if (list[i] != null)
         {
-          if (i > 0)
+          if (v.length()>0)
           {
             v.append(separator);
           }