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/15 08:44:18 UTC

[camel] branch master updated: 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 master
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/master by this push:
     new 35fe538  CAMEL-13058: AbstractFutureCallback generates NPE when response is a 401
35fe538 is described below

commit 35fe538eeef5f38904eeb041a37ba158c53d43d2
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());