Method getPhoto of Photo model should return false on error
Instead of red circle image, which breaks proxy module
This commit is contained in:
parent
4e38bc8a0d
commit
bbbc15a5eb
2 changed files with 4 additions and 3 deletions
|
@ -138,9 +138,7 @@ class Photo extends BaseObject
|
|||
$params = ["order" => ["scale" => true]];
|
||||
|
||||
$photo = self::selectFirst([], $conditions, $params);
|
||||
if ($photo === false) {
|
||||
return self::createPhotoForSystemResource("images/nosign.jpg");
|
||||
}
|
||||
|
||||
return $photo;
|
||||
}
|
||||
|
||||
|
|
|
@ -69,6 +69,9 @@ class Photo extends BaseModule
|
|||
$photoid = substr($photoid, 0, -2);
|
||||
}
|
||||
$photo = MPhoto::getPhoto($photoid, $scale);
|
||||
if ($photo === false) {
|
||||
$photo = MPhoto::createPhotoForSystemResource("images/nosign.jpg");
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue