NIFI-4103: Return an empty Optional if an IP address cannot be found

Signed-off-by: Matt Burgess <mattyb149@apache.org>

This closes #1933
This commit is contained in:
Mark Payne 2017-06-21 15:02:23 -04:00 committed by Matt Burgess
parent ff65b42e88
commit 8878d732dd
1 changed files with 4 additions and 0 deletions

View File

@ -338,6 +338,10 @@ public class IPLookupService extends AbstractControllerService implements Record
anonymousIpRecord = null;
}
if (geoRecord == null && ispRecord == null && domainName == null && connectionType == null && anonymousIpRecord == null) {
return Optional.empty();
}
return Optional.ofNullable(createContainerRecord(geoRecord, ispRecord, domainName, connectionType, anonymousIpRecord));
}