Skip to content

Commit

Permalink
NIFI-3946: Fixed issues where null values were returned instead of em…
Browse files Browse the repository at this point in the history
…pty optionals
  • Loading branch information
markap14 committed May 22, 2017
1 parent d981ac0 commit 6f09a80
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,12 @@ public void cacheConfiguredValues(final ConfigurationContext context) {
@Override
public Optional<String> lookup(final Map<String, String> coordinates) {
if (coordinates == null) {
return null;
return Optional.empty();
}

final String key = coordinates.get(KEY);
if (key == null) {
return null;
return Optional.empty();
}

return Optional.ofNullable(lookupValues.get(key));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ public Optional<Record> lookup(final Map<String, String> coordinates) throws Loo

final String ipAddress = coordinates.get(IP_KEY);
if (ipAddress == null) {
return null;
return Optional.empty();
}

final InetAddress inetAddress;
Expand Down

0 comments on commit 6f09a80

Please sign in to comment.