markap14 commented on code in PR #6408:
URL: https://github.com/apache/nifi/pull/6408#discussion_r968802703


##########
nifi-toolkit/nifi-toolkit-cli/src/main/java/org/apache/nifi/toolkit/cli/impl/command/nifi/params/SetParam.java:
##########
@@ -88,7 +88,7 @@ public VoidResult doExecute(final NiFiClient client, final 
Properties properties
             throw new IllegalArgumentException("A parameter value is required 
when creating a new parameter");
         }
 
-        if (existingParam.isPresent() && 
existingParam.get().getValue().equals(paramValue)) {

Review Comment:
   This will address the case of a null value getting set to a non-null value.
   But what about the opposite? If you wanted to set a populated value to a 
null? We'd get a NPE in that case, no?
   Recommend using `Objects.equals` to check equality instead. I.e., 
`Objects.equals(existingParam.get().getValue(), paramValue)`



-- 
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]

Reply via email to