Merge pull request #9494 from MrPetovan/bug/9491-model-id-0

Allow models extending BaseModel to have an id equal to 0
This commit is contained in:
Michael Vogel 2020-11-05 23:28:47 +01:00 committed by GitHub
commit 6d9e170502
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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');
}
}