Skip to content

Commit

Permalink
Merge pull request #79 from pelias/is-empty-iso
Browse files Browse the repository at this point in the history
Change isUndefined to isEmpty which covers more cases
  • Loading branch information
Diana Shkolnikov committed Dec 5, 2016
2 parents a60948d + 7b6d1ae commit 3335060
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/lookupStream.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,13 @@ function createLookupStream(resolver, config) {
var countryCode = getCountryCode(result);

// set code if available
if (!_.isUndefined(countryCode)) {
if (!_.isEmpty(countryCode)) {
doc.setAlpha3(countryCode);
}
else {
// TBD: remove this after debugging is done!!!
logger.error('no country code', result);
}

setFields(result.country, doc, 'country', countryCode);
setFields(result.macroregion, doc, 'macroregion');
Expand Down

0 comments on commit 3335060

Please sign in to comment.