Skip to content

Commit

Permalink
GH-1134: Fix NPE in SimpleFunctionRegistry#isExtractPayload()
Browse files Browse the repository at this point in the history
Resolves #1134
  • Loading branch information
sobychacko committed Apr 9, 2024
1 parent 17dbaa0 commit d38ab94
Showing 1 changed file with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2019-2023 the original author or authors.
* Copyright 2019-2024 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.
Expand Down Expand Up @@ -1175,14 +1175,13 @@ private boolean isExtractPayload(Message<?> message, Type type) {
if (ObjectUtils.isArray(payload)) {
payload = CollectionUtils.arrayToList(payload);
}
if (payload instanceof Collection && !CollectionUtils.isEmpty((Collection<?>) payload)
&& Message.class.isAssignableFrom(CollectionUtils.findCommonElementType((Collection<?>) payload))) {
return true;
}
if (this.containsRetainMessageSignalInHeaders(message)) {
return false;
if (payload instanceof Collection && !CollectionUtils.isEmpty((Collection<?>) payload)) {
Class<?> commonElementType = CollectionUtils.findCommonElementType((Collection<?>) payload);
if (commonElementType != null && Message.class.isAssignableFrom(commonElementType)) {
return true;
}
}
return true;
return !this.containsRetainMessageSignalInHeaders(message);
}

/**
Expand Down

0 comments on commit d38ab94

Please sign in to comment.