minor bug fix

safety check to replace prompt to stop unsightly error if user backs out
This commit is contained in:
An Orbit 2024-05-20 01:00:07 -04:00 committed by GitHub
parent 84473c767d
commit 57405dffbb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 0 deletions

View File

@ -37987,6 +37987,7 @@ Make sure to save your command in a file if you want to add this preset again.`
function replaceElementPrompt() {
var fromElement = prompt("Enter the element you want to change");
// replace spaces with underscores
if(fromElement == null) { return };
fromElement = fromElement.replace(/ /g, "_");
fromElementS = mostSimilarElement(fromElement);
if (fromElementS === null || fromElementS === undefined || fromElementS === "") {