diff --git a/src/Libs/Model.php b/src/Libs/Model.php index 3538ab2..9f611ab 100644 --- a/src/Libs/Model.php +++ b/src/Libs/Model.php @@ -250,7 +250,8 @@ class Model { foreach ($elem as $key => $value) { $index = array_search($key, $propertyNames); - if (is_numeric($index) && enum_exists($properties[$index]->getType()->getName())) + if (is_numeric($index) && isset($value) && + enum_exists($properties[$index]->getType()->getName())) $instance->$key = $properties[$index]->getType()->getName()::tryfrom($value); else $instance->$key = $value;