diff --git a/taxonium_component/src/utils/deckglToSvg.js b/taxonium_component/src/utils/deckglToSvg.js index 1d1a895a..0d7e8f68 100644 --- a/taxonium_component/src/utils/deckglToSvg.js +++ b/taxonium_component/src/utils/deckglToSvg.js @@ -37,7 +37,7 @@ const accessOrConstant = (accessor, node) => { }; if(!viewState.min_x){ window.alert("Please zoom in and out a little before SVG export") - return + return false } let svgContent = `` @@ -142,6 +142,9 @@ const accessOrConstant = (accessor, node) => { const svgWidth = deckSize.width const svgHeight = deckSize.height const svgContent = getSVG(layers, viewState, svgWidth, svgHeight); + if (!svgContent) { + return; + } // Create a new blob object const blob = new Blob([svgContent], { type: "image/svg+xml" }); // Create a link element, hide it, direct it towards the blob, and then 'click' it programatically