diff --git a/src/jojoe77777/FormAPI/ModalForm.php b/src/jojoe77777/FormAPI/ModalForm.php index 3f46c92..b008bee 100755 --- a/src/jojoe77777/FormAPI/ModalForm.php +++ b/src/jojoe77777/FormAPI/ModalForm.php @@ -23,9 +23,17 @@ public function __construct(?callable $callable) { $this->data["button2"] = ""; } - public function processData(&$data) : void { - if(!is_bool($data)) { - throw new FormValidationException("Expected a boolean response, got " . gettype($data)); + // The error related to the "Esc" key has been fixed + + public function processData(&$data): void + { + if ($data === null) { + $data = null; + return; + } + + if (!is_bool($data)) { + throw new FormValidationException("Expected an integer response, got " . gettype($data)); } }