You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@aries.apache.org by cs...@apache.org on 2018/10/04 16:20:52 UTC

[aries-jax-rs-whiteboard] 02/02: [ARIES-1842] Handle null returns

This is an automated email from the ASF dual-hosted git repository.

csierra pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/aries-jax-rs-whiteboard.git

commit 843fd7a21a6858fa790566dd24d26561193c0166
Author: Carlos Sierra <cs...@apache.org>
AuthorDate: Thu Oct 4 18:19:05 2018 +0200

    [ARIES-1842] Handle null returns
    
    fixes #ARIES-1842
---
 .../whiteboard/internal/cxf/CxfJaxrsServiceRegistrator.java  | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/jax-rs.whiteboard/src/main/java/org/apache/aries/jax/rs/whiteboard/internal/cxf/CxfJaxrsServiceRegistrator.java b/jax-rs.whiteboard/src/main/java/org/apache/aries/jax/rs/whiteboard/internal/cxf/CxfJaxrsServiceRegistrator.java
index d275acc..0b6c4b7 100644
--- a/jax-rs.whiteboard/src/main/java/org/apache/aries/jax/rs/whiteboard/internal/cxf/CxfJaxrsServiceRegistrator.java
+++ b/jax-rs.whiteboard/src/main/java/org/apache/aries/jax/rs/whiteboard/internal/cxf/CxfJaxrsServiceRegistrator.java
@@ -211,6 +211,10 @@ public class CxfJaxrsServiceRegistrator {
 
         Application application = _applicationTuple.getService();
 
+        if (application == null) {
+            return;
+        }
+
         if (_services.isEmpty() &&
             application.getSingletons().isEmpty() &&
             application.getClasses().isEmpty()) {
@@ -250,7 +254,13 @@ public class CxfJaxrsServiceRegistrator {
 
             Object service = provider.getService();
 
-            if (service instanceof Feature || service instanceof DynamicFeature) {
+            if (service == null) {
+                continue;
+            }
+
+            if (service instanceof Feature ||
+                service instanceof DynamicFeature) {
+
                 _jaxRsServerFactoryBean.setProvider(service);
 
                 continue;