You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by dm...@apache.org on 2019/01/10 10:07:51 UTC

[camel] branch camel-2.23.x updated: CAMEL-13012: AbstractFutureCallback generates NPE when response is a 401

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

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


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

commit acdf24b54faf9f87c6ff87d6808408c9437a28aa
Author: Dmitry Volodin <dm...@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);