This is an automated email from the ASF dual-hosted git repository.
dmvolod pushed a commit to branch camel-2.21.x
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/camel-2.21.x by this push:
new 72ec54e CAMEL-13012: AbstractFutureCallback generates NPE when
response is a 401
72ec54e is described below
commit 72ec54e0e79a6a897dd60d90eb70ed914f248ee8
Author: Dmitry Volodin <[email protected]>
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 b710f04..9046e11 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
@@ -62,7 +62,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);