Hello Ottomata,

I'd like you to do a code review.  Please visit

    https://gerrit.wikimedia.org/r/190092

to review the following change.

Change subject: Fix NPE in GeocodedDataUDF for countries with iso code but no 
name
......................................................................

Fix NPE in GeocodedDataUDF for countries with iso code but no name

As our tests rely on MaxMind's test databases for now and those do not
come with an instance of this setting, we do not have a test for this
defect.

Bug: T89204
Change-Id: Iefd55dfee03765aec5c0af886aafb84d2a97d76c
---
M refinery-core/src/main/java/org/wikimedia/analytics/refinery/core/Geocode.java
1 file changed, 2 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/analytics/refinery/source 
refs/changes/92/190092/1

diff --git 
a/refinery-core/src/main/java/org/wikimedia/analytics/refinery/core/Geocode.java
 
b/refinery-core/src/main/java/org/wikimedia/analytics/refinery/core/Geocode.java
index 1bfb909..cc69a7d 100644
--- 
a/refinery-core/src/main/java/org/wikimedia/analytics/refinery/core/Geocode.java
+++ 
b/refinery-core/src/main/java/org/wikimedia/analytics/refinery/core/Geocode.java
@@ -167,7 +167,8 @@
             geoData.put(CONTINENT, continent.getName());
 
         Country country = response.getCountry();
-        if (country != null && country.getIsoCode() != null) {
+        if (country != null && country.getIsoCode() != null
+                && country.getName() != null) {
             geoData.put(COUNTRY_CODE, country.getIsoCode());
             geoData.put(COUNTRY, country.getName());
         }

-- 
To view, visit https://gerrit.wikimedia.org/r/190092
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iefd55dfee03765aec5c0af886aafb84d2a97d76c
Gerrit-PatchSet: 1
Gerrit-Project: analytics/refinery/source
Gerrit-Branch: master
Gerrit-Owner: QChris <christ...@quelltextlich.at>
Gerrit-Reviewer: Ottomata <o...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to