You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@felix.apache.org by fm...@apache.org on 2010/03/22 15:55:35 UTC

svn commit: r926111 - /felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/WebConsoleUtil.java

Author: fmeschbe
Date: Mon Mar 22 14:55:35 2010
New Revision: 926111

URL: http://svn.apache.org/viewvc?rev=926111&view=rev
Log:
Prevent NPE if value to decode is null (and also shortcut if the value is an empty string)

Modified:
    felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/WebConsoleUtil.java

Modified: felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/WebConsoleUtil.java
URL: http://svn.apache.org/viewvc/felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/WebConsoleUtil.java?rev=926111&r1=926110&r2=926111&view=diff
==============================================================================
--- felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/WebConsoleUtil.java (original)
+++ felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/WebConsoleUtil.java Mon Mar 22 14:55:35 2010
@@ -350,6 +350,12 @@ public final class WebConsoleUtil
      */
     public static String urlDecode( final String value )
     {
+        // shortcut for empty or missing values
+        if ( value == null || value.length() == 0 )
+        {
+            return null;
+        }
+
         try
         {
             return URLDecoder.decode( value, "UTF-8" );