DATACMNS-828 - Fixed potential NullPointerException in ResultProcessor.

ResultProcessor.processResult(…) now explicitly handles null values to prevent IllegalArgumentExceptions being provoked in the ProjectionFactory which occurred if null values were handed down to it.
This commit is contained in:
Oliver Gierke
2016-03-11 15:02:56 +01:00
parent 9dc23ed555
commit c57bfec696
2 changed files with 11 additions and 3 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2015 the original author or authors.
* Copyright 2015-2016 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -121,7 +121,7 @@ public class ResultProcessor {
@SuppressWarnings("unchecked")
public <T> T processResult(Object source, Converter<Object, Object> preparingConverter) {
if (type.isInstance(source) || !type.isProjecting()) {
if (source == null || type.isInstance(source) || !type.isProjecting()) {
return (T) source;
}