From 5426d86b06372751323795fb9f88153934126801 Mon Sep 17 00:00:00 2001 From: jprocter Date: Thu, 25 Aug 2011 10:24:27 +0100 Subject: [PATCH] JAL-715 - prevent empty elements being generated --- src/jalview/ws/rest/RestServiceDescription.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/jalview/ws/rest/RestServiceDescription.java b/src/jalview/ws/rest/RestServiceDescription.java index fe1434c..db35a2b 100644 --- a/src/jalview/ws/rest/RestServiceDescription.java +++ b/src/jalview/ws/rest/RestServiceDescription.java @@ -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); } -- 1.7.10.2