base64: error handling
This commit is contained in:
parent
ed1da1faf0
commit
610b20019b
@ -176,8 +176,8 @@ class FormElement extends InterfaceElement {
|
|||||||
this.#dataType = x;
|
this.#dataType = x;
|
||||||
}
|
}
|
||||||
|
|
||||||
#value;
|
|
||||||
get value() {
|
get value() {
|
||||||
|
this.clearAlerts();
|
||||||
switch (this.dataType) {
|
switch (this.dataType) {
|
||||||
case "plaintext":
|
case "plaintext":
|
||||||
return this.handle.value;
|
return this.handle.value;
|
||||||
@ -185,7 +185,8 @@ class FormElement extends InterfaceElement {
|
|||||||
try {
|
try {
|
||||||
return b64ToBuf(this.handle.value);
|
return b64ToBuf(this.handle.value);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
// TODO
|
this.alertBox("alert-error", "Invalid base64 value.");
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
case "none":
|
case "none":
|
||||||
return undefined;
|
return undefined;
|
||||||
|
Loading…
Reference in New Issue
Block a user