felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r1799927 - /felix/trunk/gogo/runtime/src/main/java/org/apache/felix/gogo/runtime/Expression.java
Date Mon, 26 Jun 2017 15:15:36 GMT
Author: gnodet
Date: Mon Jun 26 15:15:36 2017
New Revision: 1799927

URL: http://svn.apache.org/viewvc?rev=1799927&view=rev
Log:
[FELIX-5655] Possible NPE in Expression.isNumber when passing an empty string

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

Modified: felix/trunk/gogo/runtime/src/main/java/org/apache/felix/gogo/runtime/Expression.java
URL: http://svn.apache.org/viewvc/felix/trunk/gogo/runtime/src/main/java/org/apache/felix/gogo/runtime/Expression.java?rev=1799927&r1=1799926&r2=1799927&view=diff
==============================================================================
--- felix/trunk/gogo/runtime/src/main/java/org/apache/felix/gogo/runtime/Expression.java (original)
+++ felix/trunk/gogo/runtime/src/main/java/org/apache/felix/gogo/runtime/Expression.java Mon
Jun 26 15:15:36 2017
@@ -1048,7 +1048,7 @@ public class Expression {
      * @return <code>true</code>, if the input string is a number.
      */
     private boolean isNumber(String st) {
-        if (st.charAt(0) == minusSign && st.length() == 1)
+        if (st == null || st.isEmpty() || st.charAt(0) == minusSign && st.length()
== 1)
             return false;
         for (char ch : st.toCharArray()) {
             if (!Character.isDigit(ch) && ch != minusSign



Mime
View raw message