Improve guards to avoid potential ClassCastException.
We now guard Slice conversion against potential ClassCastException using the proper condition grouping. Previously, the conversion could happen if the query is a slice query while the source was not a Slice. Resolves #2296.
This commit is contained in:
@@ -143,7 +143,7 @@ public class ResultProcessor {
|
||||
|
||||
ChainingConverter converter = ChainingConverter.of(type.getReturnedType(), preparingConverter).and(this.converter);
|
||||
|
||||
if (source instanceof Slice && method.isPageQuery() || method.isSliceQuery()) {
|
||||
if (source instanceof Slice && (method.isPageQuery() || method.isSliceQuery())) {
|
||||
return (T) ((Slice<?>) source).map(converter::convert);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user