Repository: nifi Updated Branches: refs/heads/master ff65b42e8 -> 8878d732d
NIFI-4103: Return an empty Optional if an IP address cannot be found Signed-off-by: Matt Burgess <[email protected]> This closes #1933 Project: http://git-wip-us.apache.org/repos/asf/nifi/repo Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/8878d732 Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/8878d732 Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/8878d732 Branch: refs/heads/master Commit: 8878d732dd4d6e862712aeaa5cc46e7c06d28892 Parents: ff65b42 Author: Mark Payne <[email protected]> Authored: Wed Jun 21 15:02:23 2017 -0400 Committer: Matt Burgess <[email protected]> Committed: Fri Jun 23 11:14:57 2017 -0400 ---------------------------------------------------------------------- .../java/org/apache/nifi/lookup/maxmind/IPLookupService.java | 4 ++++ 1 file changed, 4 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/nifi/blob/8878d732/nifi-nar-bundles/nifi-standard-services/nifi-lookup-services-bundle/nifi-lookup-services/src/main/java/org/apache/nifi/lookup/maxmind/IPLookupService.java ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-standard-services/nifi-lookup-services-bundle/nifi-lookup-services/src/main/java/org/apache/nifi/lookup/maxmind/IPLookupService.java b/nifi-nar-bundles/nifi-standard-services/nifi-lookup-services-bundle/nifi-lookup-services/src/main/java/org/apache/nifi/lookup/maxmind/IPLookupService.java index 096f1a6..58c868f 100644 --- a/nifi-nar-bundles/nifi-standard-services/nifi-lookup-services-bundle/nifi-lookup-services/src/main/java/org/apache/nifi/lookup/maxmind/IPLookupService.java +++ b/nifi-nar-bundles/nifi-standard-services/nifi-lookup-services-bundle/nifi-lookup-services/src/main/java/org/apache/nifi/lookup/maxmind/IPLookupService.java @@ -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)); }
