base64: error handling

This commit is contained in:
dogeystamp 2022-12-30 17:31:28 -05:00
parent ed1da1faf0
commit 610b20019b
Signed by: dogeystamp
GPG Key ID: 7225FE3592EFFA38

View File

@ -176,8 +176,8 @@ class FormElement extends InterfaceElement {
this.#dataType = x;
}
#value;
get value() {
this.clearAlerts();
switch (this.dataType) {
case "plaintext":
return this.handle.value;
@ -185,7 +185,8 @@ class FormElement extends InterfaceElement {
try {
return b64ToBuf(this.handle.value);
} catch (e) {
// TODO
this.alertBox("alert-error", "Invalid base64 value.");
return;
}
case "none":
return undefined;