naziD commented on code in PR #9622:
URL: https://github.com/apache/dolphinscheduler/pull/9622#discussion_r854735259
##########
dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/TaskDefinition.java:
##########
@@ -309,9 +309,18 @@ public void setTaskParamMap(Map<String, String>
taskParamMap) {
public Map<String, String> getTaskParamMap() {
if (taskParamMap == null && StringUtils.isNotEmpty(taskParams)) {
JsonNode localParams =
JSONUtils.parseObject(taskParams).findValue("localParams");
- if (localParams != null) {
+
+ //If a jsonNode is null, not only use !=null, but also it should
use the isNull method to be estimated.
+ if (localParams != null && !localParams.isNull()) {
List<Property> propList =
JSONUtils.toList(localParams.toString(), Property.class);
- taskParamMap =
propList.stream().collect(Collectors.toMap(Property::getProp,
Property::getValue));
+
+ if (CollectionUtils.isNotEmpty(propList)) {
+ taskParamMap = new HashMap<>();
+ // Don't use java 8 stream to convert map, because the
value will probably null,and it will cause the NullPointException.
Review Comment:
>
It should be emphasized that the latter deployer don't use stream to convert
the map . The key reason of this issue is caused by it .
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]