Fix crash in Wikidata preview box

This commit is contained in:
pietervdvn 2021-12-23 23:44:40 +01:00
parent 7f829a3578
commit d7d60da148

View file

@ -138,10 +138,11 @@ export default class WikidataPreviewBox extends VariableUiElement {
const key = extraProperty.property
const display = extraProperty.display
const value: string[] = Array.from(wikidata.claims.get(key))
if (value === undefined) {
if (wikidata.claims?.get(key) === undefined) {
continue
}
const value: string[] = Array.from(wikidata.claims.get(key))
if (display instanceof Translation) {
els.push(display.Subs({value: value.join(", ")}).SetClass("m-2"))
continue