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/17 14:09:01 UTC

[camel] 05/05: CAMEL-13058: 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

commit 57e4dfe9746d501c2002496242a1a0c9eb75121d
Author: Dmitry Volodin <dm...@gmail.com>
AuthorDate: Tue Jan 15 11:43:36 2019 +0300

    CAMEL-13058: AbstractFutureCallback generates NPE when response is a 401
---
 .../camel/component/olingo2/api/impl/AbstractFutureCallback.java       | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/components/camel-olingo2/camel-olingo2-api/src/main/java/org/apache/camel/component/olingo2/api/impl/AbstractFutureCallback.java b/components/camel-olingo2/camel-olingo2-api/src/main/java/org/apache/camel/component/olingo2/api/impl/AbstractFutureCallback.java
index 08df91f..ea64815 100644
--- a/components/camel-olingo2/camel-olingo2-api/src/main/java/org/apache/camel/component/olingo2/api/impl/AbstractFutureCallback.java
+++ b/components/camel-olingo2/camel-olingo2-api/src/main/java/org/apache/camel/component/olingo2/api/impl/AbstractFutureCallback.java
@@ -55,8 +55,7 @@ public abstract class AbstractFutureCallback<T> implements FutureCallback<HttpRe
                 try {
                     final ContentType responseContentType = getContentTypeHeader(response);
 
-                    final String mimeType = responseContentType.getMimeType();
-                    if (ODATA_MIME_TYPE.matcher(mimeType).matches()) {
+                    if (responseContentType != null && ODATA_MIME_TYPE.matcher(responseContentType.getMimeType()).matches()) {
                         final ODataErrorContext errorContext = EntityProvider.readErrorDocument(
                             response.getEntity().getContent(),
                             responseContentType.toString());