diff --git a/src/BaseModel.php b/src/BaseModel.php index 8f9370bb0..41320d8bd 100644 --- a/src/BaseModel.php +++ b/src/BaseModel.php @@ -141,7 +141,7 @@ abstract class BaseModel extends BaseEntity protected function checkValid() { - if (empty($this->data['id'])) { + if (!isset($this->data['id']) || is_null($this->data['id'])) { throw new HTTPException\InternalServerErrorException(static::class . ' record uninitialized'); } }