]> git.mxchange.org Git - friendica.git/commitdiff
Allow models extending BaseModel to have an id equal to 0
authorHypolite Petovan <hypolite@mrpetovan.com>
Thu, 5 Nov 2020 15:03:40 +0000 (10:03 -0500)
committerHypolite Petovan <hypolite@mrpetovan.com>
Thu, 5 Nov 2020 15:03:40 +0000 (10:03 -0500)
src/BaseModel.php

index 8f9370bb09aa4f2b1574e49ec2c02918b4959fa1..41320d8bd5bcf528529b9a6f623babf9bfe84508 100644 (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');
                }
        }