Commit 0559d636 authored by Tobinsk's avatar Tobinsk
Browse files

Merge branch '8-typology-undefined' into 'master'

Resolve "typology undefined"

Closes #8

See merge request histhub/wikidata-normalizer!17
parents 45b365cd 374e30ec
......@@ -161,7 +161,8 @@ class WikiNormalizer extends Transform {
// Check for geographical instances
return obj.claims.P31.map((instanceOf) => {
try {
return instanceOf.mainsnak.datavalue.value.id || null;
return typeof instanceOf.mainsnak.datavalue.value.id === 'undefined' ?
null : instanceOf.mainsnak.datavalue.value.id;
} catch (err) {}
});
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment