small fix for legend font load

This commit is contained in:
Azgaar 2021-07-12 23:51:57 +03:00
parent 6dc8cad13e
commit 9301631537

View file

@ -47,7 +47,7 @@ function getFontsList(svg) {
const font = this.dataset.font;
if (font) fontsInUse.push(font);
});
if (legend.node().hasChildNodes()) fontsInUse.push(legend.attr("data-font"));
if (legend?.node()?.hasChildNodes()) fontsInUse.push(legend.attr("data-font"));
return [...new Set(fontsInUse)];
}