felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r1736030 - /felix/trunk/gogo/runtime/src/main/java/org/apache/felix/gogo/runtime/Closure.java
Date Mon, 21 Mar 2016 16:56:45 GMT
Author: gnodet
Date: Mon Mar 21 16:56:45 2016
New Revision: 1736030

URL: http://svn.apache.org/viewvc?rev=1736030&view=rev
Log:
Fix possible exception

Modified:
    felix/trunk/gogo/runtime/src/main/java/org/apache/felix/gogo/runtime/Closure.java

Modified: felix/trunk/gogo/runtime/src/main/java/org/apache/felix/gogo/runtime/Closure.java
URL: http://svn.apache.org/viewvc/felix/trunk/gogo/runtime/src/main/java/org/apache/felix/gogo/runtime/Closure.java?rev=1736030&r1=1736029&r2=1736030&view=diff
==============================================================================
--- felix/trunk/gogo/runtime/src/main/java/org/apache/felix/gogo/runtime/Closure.java (original)
+++ felix/trunk/gogo/runtime/src/main/java/org/apache/felix/gogo/runtime/Closure.java Mon
Mar 21 16:56:45 2016
@@ -334,7 +334,7 @@ public class Closure implements Function
                 return result;
             } else {
                 String s = baos.toString();
-                while (s.charAt(s.length() - 1) == '\n') {
+                while (!s.isEmpty() && s.charAt(s.length() - 1) == '\n') {
                     s = s.substring(0, s.length() - 1);
                 }
                 return s;



Mime
View raw message