cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r984493 - /cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/UriBuilderImpl.java
Date Wed, 11 Aug 2010 17:42:59 GMT
Author: dkulp
Date: Wed Aug 11 17:42:58 2010
New Revision: 984493

URL: http://svn.apache.org/viewvc?rev=984493&view=rev
Log:
Add an NPE guard

Modified:
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/UriBuilderImpl.java

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/UriBuilderImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/UriBuilderImpl.java?rev=984493&r1=984492&r2=984493&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/UriBuilderImpl.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/UriBuilderImpl.java
Wed Aug 11 17:42:58 2010
@@ -550,12 +550,14 @@ public class UriBuilderImpl extends UriB
      */
     private List<String> toStringList(Object... values) throws IllegalArgumentException
{
         List<String> list = new ArrayList<String>();
-        for (int i = 0; i < values.length; i++) {
-            Object value = values[i];
-            if (value == null) {
-                throw new IllegalArgumentException("Null value on " + i + " position");
+        if (values != null) {
+            for (int i = 0; i < values.length; i++) {
+                Object value = values[i];
+                if (value == null) {
+                    throw new IllegalArgumentException("Null value on " + i + " position");
+                }
+                list.add(value.toString());
             }
-            list.add(value.toString());
         }
         if (list.isEmpty()) {
             list.add("");



Mime
View raw message