Return-Path: X-Original-To: apmail-cxf-commits-archive@www.apache.org Delivered-To: apmail-cxf-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D15E218C95 for ; Fri, 21 Aug 2015 12:37:07 +0000 (UTC) Received: (qmail 12023 invoked by uid 500); 21 Aug 2015 12:37:07 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 11965 invoked by uid 500); 21 Aug 2015 12:37:07 -0000 Mailing-List: contact commits-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list commits@cxf.apache.org Received: (qmail 11956 invoked by uid 99); 21 Aug 2015 12:37:07 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 21 Aug 2015 12:37:07 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 72309E0102; Fri, 21 Aug 2015 12:37:07 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: sergeyb@apache.org To: commits@cxf.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: cxf git commit: Avoding a possible NPE in the async conduit factory Date: Fri, 21 Aug 2015 12:37:07 +0000 (UTC) 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 Authored: Fri Aug 21 13:36:52 2015 +0100 Committer: Sergey Beryozkin 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 {