Repository: cxf Updated Branches: refs/heads/master 9f32e2bf5 -> c7a8af405
Avoding a possible NPE in the async conduit factory Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/c7a8af40 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/c7a8af40 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/c7a8af40 Branch: refs/heads/master Commit: c7a8af405f4766ada611a39e0675c39a6322e175 Parents: 9f32e2b Author: Sergey Beryozkin <[email protected]> Authored: Fri Aug 21 13:36:52 2015 +0100 Committer: Sergey Beryozkin <[email protected]> Committed: Fri Aug 21 13:36:52 2015 +0100 ---------------------------------------------------------------------- .../asyncclient/AsyncHTTPConduitFactory.java | 22 ++++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cxf/blob/c7a8af40/rt/transports/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/AsyncHTTPConduitFactory.java ---------------------------------------------------------------------- diff --git a/rt/transports/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/AsyncHTTPConduitFactory.java b/rt/transports/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/AsyncHTTPConduitFactory.java index 089ed04..a5b94bf 100644 --- a/rt/transports/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/AsyncHTTPConduitFactory.java +++ b/rt/transports/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/AsyncHTTPConduitFactory.java @@ -282,15 +282,19 @@ public class AsyncHTTPConduitFactory implements HTTPConduitFactory { private void addListener(Bus b) { - b.getExtension(BusLifeCycleManager.class).registerLifeCycleListener(new BusLifeCycleListener() { - public void initComplete() { - } - public void preShutdown() { - shutdown(); - } - public void postShutdown() { - } - }); + BusLifeCycleManager manager = b.getExtension(BusLifeCycleManager.class); + if (manager != null) { + + manager.registerLifeCycleListener(new BusLifeCycleListener() { + public void initComplete() { + } + public void preShutdown() { + shutdown(); + } + public void postShutdown() { + } + }); + } } public synchronized void setupNIOClient(HTTPClientPolicy clientPolicy) throws IOReactorException {
