commit | ae397c7d023edcc3461230edcbca70821ffe943c | [log] [tgz] |
---|---|---|
author | Felix Meschberger <fmeschbe@apache.org> | Mon Mar 22 14:55:35 2010 +0000 |
committer | Felix Meschberger <fmeschbe@apache.org> | Mon Mar 22 14:55:35 2010 +0000 |
tree | 7795dd2f7bbf504d87192169b04534e147f91fc3 | |
parent | 88f851c2dbdcb863bf00e0be396dc7f77968027d [diff] |
Prevent NPE if value to decode is null (and also shortcut if the value is an empty string) git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@926111 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/webconsole/src/main/java/org/apache/felix/webconsole/WebConsoleUtil.java b/webconsole/src/main/java/org/apache/felix/webconsole/WebConsoleUtil.java index 850ee4d..7ff5b55 100644 --- a/webconsole/src/main/java/org/apache/felix/webconsole/WebConsoleUtil.java +++ b/webconsole/src/main/java/org/apache/felix/webconsole/WebConsoleUtil.java
@@ -350,6 +350,12 @@ */ 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" );