diff --git a/lib/Exceptions/AbstractSafeException.php b/lib/Exceptions/AbstractSafeException.php index 2e36f09c..1e426242 100644 --- a/lib/Exceptions/AbstractSafeException.php +++ b/lib/Exceptions/AbstractSafeException.php @@ -8,6 +8,10 @@ abstract class AbstractSafeException extends \ErrorException implements SafeExce public static function createFromPhpError(): self { $error = error_get_last(); + + if ($error === null) { + return new static(); + } return new static($error['message'], 0, $error['type']); }