diff --git a/src/Convert.php b/src/Convert.php index 24e2d43..8197fbb 100644 --- a/src/Convert.php +++ b/src/Convert.php @@ -60,7 +60,12 @@ class Convert return $inputDate; } $errors = $date->getLastErrors(); - if ($errors["warning_count"] > 0 || $errors["error_count"] > 0) { + if ( + $errors !== false && ( + $errors["warning_count"] > 0 || + $errors["error_count"] > 0 + ) + ) { if ($exception === true) { throw new \Exception( "Invalid date provided or not matching the format",