[CXF-5725] Fix NPE when no Accept for Offer

Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/95d6cfcd
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/95d6cfcd
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/95d6cfcd

Branch: refs/heads/master
Commit: 95d6cfcd27d16d37497875125a1a0c6aa276fcd5
Parents: 021646d
Author: dsosnoski <[email protected]>
Authored: Fri May 2 11:29:41 2014 +1200
Committer: dsosnoski <[email protected]>
Committed: Fri May 2 12:13:21 2014 +1200

----------------------------------------------------------------------
 .../src/main/java/org/apache/cxf/ws/rm/Servant.java  | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/95d6cfcd/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/Servant.java
----------------------------------------------------------------------
diff --git a/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/Servant.java 
b/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/Servant.java
index 319e320..96d86b3 100644
--- a/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/Servant.java
+++ b/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/Servant.java
@@ -214,13 +214,14 @@ public class Servant implements Invoker {
         Identifier offeredId = 
reliableEndpoint.getProxy().getOfferedIdentifier();
         if (null != offeredId) {
             AcceptType accept = createResponse.getAccept();
-            assert null != accept;
-            Destination dest = reliableEndpoint.getDestination();
-            String address = accept.getAcksTo().getAddress().getValue();
-            if 
(!RMUtils.getAddressingConstants().getNoneURI().equals(address)) {
-                DestinationSequence ds =  new DestinationSequence(offeredId, 
accept.getAcksTo(), dest,
-                    protocol);
-                dest.addSequence(ds);
+            if (accept != null) {
+                Destination dest = reliableEndpoint.getDestination();
+                String address = accept.getAcksTo().getAddress().getValue();
+                if 
(!RMUtils.getAddressingConstants().getNoneURI().equals(address)) {
+                    DestinationSequence ds =  new 
DestinationSequence(offeredId, accept.getAcksTo(), dest,
+                                                                      
protocol);
+                    dest.addSequence(ds);
+                }
             }
         }
     }

Reply via email to