cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject cxf git commit: Avoid a NPE in websocket transport
Date Wed, 01 Jun 2016 13:49:33 GMT
Repository: cxf
Updated Branches:
  refs/heads/3.0.x-fixes cd6c50901 -> da8e5fbc2


Avoid a NPE in websocket transport


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

Branch: refs/heads/3.0.x-fixes
Commit: da8e5fbc2b5179341f4107c9d24e184b7876eb14
Parents: cd6c509
Author: Colm O hEigeartaigh <coheigea@apache.org>
Authored: Wed Jun 1 14:47:15 2016 +0100
Committer: Colm O hEigeartaigh <coheigea@apache.org>
Committed: Wed Jun 1 14:48:23 2016 +0100

----------------------------------------------------------------------
 .../cxf/transport/websocket/WebSocketTransportFactory.java      | 5 +++++
 1 file changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/da8e5fbc/rt/transports/websocket/src/main/java/org/apache/cxf/transport/websocket/WebSocketTransportFactory.java
----------------------------------------------------------------------
diff --git a/rt/transports/websocket/src/main/java/org/apache/cxf/transport/websocket/WebSocketTransportFactory.java
b/rt/transports/websocket/src/main/java/org/apache/cxf/transport/websocket/WebSocketTransportFactory.java
index 96a5587..b1da539 100644
--- a/rt/transports/websocket/src/main/java/org/apache/cxf/transport/websocket/WebSocketTransportFactory.java
+++ b/rt/transports/websocket/src/main/java/org/apache/cxf/transport/websocket/WebSocketTransportFactory.java
@@ -134,6 +134,11 @@ public class WebSocketTransportFactory extends AbstractTransportFactory
implemen
             AbstractHTTPDestination d = registry.getDestinationForPath(endpointInfo.getAddress());
             if (d == null) {
                 d = factory.createDestination(endpointInfo, bus, registry);
+                if (d == null) {
+                    String error = "No destination available. The CXF websocket transport
needs either the "
+                        + "Jetty WebSocket or Atmosphere dependencies to be available";
+                    throw new IOException(error); 
+                }
                 registry.addDestination(d);
                 configure(bus, d);
                 d.finalizeConfig();


Mime
View raw message