Commit d7b9a6f0 authored by tobinski's avatar tobinski
Browse files

Better detect names

parent 62e00a59
......@@ -196,7 +196,15 @@ class WikidataNormalizerTransformer extends Transform {
return name2;
}
return this.getAlternativNames(obj)[0];
const name3 = this.getAlternativNames(obj)[0];
if (name3 !== null) {
return name3;
}
// this often fails. Then we use null from the catch
const lang = Object.keys(obj.labels)[0];
return obj.labels[lang].value;
} catch (error) {
return null;
}
......
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