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

dmvolod pushed a commit to branch camel-2.x
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/camel-2.x by this push:
     new b17220d  CAMEL-13012: AbstractFutureCallback generates NPE when 
response is a 401
b17220d is described below

commit b17220d9d08708cbdfdfa5bfb9a885f29865da51
Author: Dmitry Volodin <dmvo...@gmail.com>
AuthorDate: Wed Jan 9 16:11:43 2019 +0300

    CAMEL-13012: AbstractFutureCallback generates NPE when response is a 401
---
 .../apache/camel/component/olingo4/api/impl/AbstractFutureCallback.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/components/camel-olingo4/camel-olingo4-api/src/main/java/org/apache/camel/component/olingo4/api/impl/AbstractFutureCallback.java
 
b/components/camel-olingo4/camel-olingo4-api/src/main/java/org/apache/camel/component/olingo4/api/impl/AbstractFutureCallback.java
index f9aab1d..fa0b650 100644
--- 
a/components/camel-olingo4/camel-olingo4-api/src/main/java/org/apache/camel/component/olingo4/api/impl/AbstractFutureCallback.java
+++ 
b/components/camel-olingo4/camel-olingo4-api/src/main/java/org/apache/camel/component/olingo4/api/impl/AbstractFutureCallback.java
@@ -57,7 +57,7 @@ public abstract class AbstractFutureCallback<T> implements 
FutureCallback<HttpRe
                 try {
                     final ContentType responseContentType = 
getContentTypeHeader(response);
                               
-                    if 
(ODATA_MIME_TYPE_PATTERN.matcher(responseContentType.toContentTypeString()).matches())
 {
+                    if (responseContentType != null && 
ODATA_MIME_TYPE_PATTERN.matcher(responseContentType.toContentTypeString()).matches())
 {
                         final ODataReader reader = 
ODataClientFactory.getClient().getReader();
                         final ODataError error = 
reader.readError(response.getEntity().getContent(), responseContentType);
                         

Reply via email to