You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by dk...@apache.org on 2012/10/03 18:03:20 UTC

svn commit: r1393574 - /cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyAnnotationListener.java

Author: dkulp
Date: Wed Oct  3 16:03:20 2012
New Revision: 1393574

URL: http://svn.apache.org/viewvc?rev=1393574&view=rev
Log:
[CXF-4526] Add an NPE guard

Modified:
    cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyAnnotationListener.java

Modified: cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyAnnotationListener.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyAnnotationListener.java?rev=1393574&r1=1393573&r2=1393574&view=diff
==============================================================================
--- cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyAnnotationListener.java (original)
+++ cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyAnnotationListener.java Wed Oct  3 16:03:20 2012
@@ -20,6 +20,7 @@
 package org.apache.cxf.ws.policy;
 
 import java.lang.reflect.Method;
+import java.net.URL;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
@@ -358,7 +359,10 @@ public class PolicyAnnotationListener im
             
             if (service.getDescription() == null && cls != null) {
                 service.setDescription(new DescriptionInfo());
-                service.getDescription().setBaseURI(cls.getResource("/").toString());
+                URL u = cls.getResource("/");
+                if (u != null) {
+                    service.getDescription().setBaseURI(u.toString());
+                }
             }
 
             // if not already added to service add it, otherwise ignore