This is an automated email from the ASF dual-hosted git repository.
zihaoxiang pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/dolphinscheduler.git
The following commit(s) were added to refs/heads/dev by this push:
new 81aa105ff6 [Fix-13820][alert] Fix bodyParams is empty get error log
(#13821)
81aa105ff6 is described below
commit 81aa105ff6c27eb28ad82166464bc5eecc59b34a
Author: kingbabingge <[email protected]>
AuthorDate: Wed Apr 19 15:35:13 2023 +0800
[Fix-13820][alert] Fix bodyParams is empty get error log (#13821)
initialize an empty objectNode to save contentField.
---
.../org/apache/dolphinscheduler/plugin/alert/http/HttpSender.java | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git
a/dolphinscheduler-alert/dolphinscheduler-alert-plugins/dolphinscheduler-alert-http/src/main/java/org/apache/dolphinscheduler/plugin/alert/http/HttpSender.java
b/dolphinscheduler-alert/dolphinscheduler-alert-plugins/dolphinscheduler-alert-http/src/main/java/org/apache/dolphinscheduler/plugin/alert/http/HttpSender.java
index c46f8cded5..ab4189bd13 100644
---
a/dolphinscheduler-alert/dolphinscheduler-alert-plugins/dolphinscheduler-alert-http/src/main/java/org/apache/dolphinscheduler/plugin/alert/http/HttpSender.java
+++
b/dolphinscheduler-alert/dolphinscheduler-alert-plugins/dolphinscheduler-alert-http/src/main/java/org/apache/dolphinscheduler/plugin/alert/http/HttpSender.java
@@ -163,7 +163,10 @@ public final class HttpSender {
*/
private void setMsgInRequestBody(String msg) {
try {
- ObjectNode objectNode = JSONUtils.parseObject(bodyParams);
+ ObjectNode objectNode = JSONUtils.createObjectNode();
+ if (StringUtils.isNotBlank(bodyParams)) {
+ objectNode = JSONUtils.parseObject(bodyParams);
+ }
// set msg content field
objectNode.put(contentField, msg);
StringEntity entity = new
StringEntity(JSONUtils.toJsonString(objectNode), DEFAULT_CHARSET);