diff --git a/modules/ui/style.js b/modules/ui/style.js index 2a4f6d2c..bbaa6a93 100644 --- a/modules/ui/style.js +++ b/modules/ui/style.js @@ -1126,8 +1126,9 @@ function addStylePreset() { position: {my: "center", at: "center", of: "svg"} }); - const currentStyle = document.getElementById("stylePreset").selectedOptions[0].text; - document.getElementById("styleSaverName").value = currentStyle; + const currentPreset = document.getElementById("stylePreset").selectedOptions[0]; + const styleName = currentPreset ? currentPreset.text : "custom"; + document.getElementById("styleSaverName").value = styleName; styleSaverJSON.value = JSON.stringify(getStyle(), null, 2); checkName();