This is an automated email from the ASF dual-hosted git repository.
lidongdai 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 a2ff140f43 Fix sql task will send alert if we don't choose the send
email (#12984)
a2ff140f43 is described below
commit a2ff140f43a19eb0e9661ce6b1dbffe14fcdd11e
Author: Wenjun Ruan <[email protected]>
AuthorDate: Thu Nov 24 21:26:52 2022 +0800
Fix sql task will send alert if we don't choose the send email (#12984)
---
.../main/java/org/apache/dolphinscheduler/plugin/task/sql/SqlTask.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git
a/dolphinscheduler-task-plugin/dolphinscheduler-task-sql/src/main/java/org/apache/dolphinscheduler/plugin/task/sql/SqlTask.java
b/dolphinscheduler-task-plugin/dolphinscheduler-task-sql/src/main/java/org/apache/dolphinscheduler/plugin/task/sql/SqlTask.java
index 391899dc56..7fe98c78f9 100644
---
a/dolphinscheduler-task-plugin/dolphinscheduler-task-sql/src/main/java/org/apache/dolphinscheduler/plugin/task/sql/SqlTask.java
+++
b/dolphinscheduler-task-plugin/dolphinscheduler-task-sql/src/main/java/org/apache/dolphinscheduler/plugin/task/sql/SqlTask.java
@@ -319,7 +319,7 @@ public class SqlTask extends AbstractTask {
String result = resultJSONArray.isEmpty() ?
JSONUtils.toJsonString(generateEmptyRow(resultSet))
: JSONUtils.toJsonString(resultJSONArray);
- if (sqlParameters.getSendEmail() == null ||
sqlParameters.getSendEmail()) {
+ if (Boolean.TRUE.equals(sqlParameters.getSendEmail())) {
sendAttachment(sqlParameters.getGroupId(),
StringUtils.isNotEmpty(sqlParameters.getTitle())
? sqlParameters.getTitle()
: taskExecutionContext.getTaskName() + " query result
sets", result);