Introduce InvalidClassStorageException and adapt the code for it

This commit is contained in:
Philipp 2021-08-10 23:56:30 +02:00
parent b798ca2da6
commit c17bc55158
No known key found for this signature in database
GPG key ID: 9A28B7D4FF5667BD
9 changed files with 259 additions and 267 deletions

View file

@ -61,6 +61,10 @@ class Crop extends BaseSettings
$base_image = Photo::selectFirst([], ['resource-id' => $resource_id, 'uid' => local_user(), 'scale' => $scale]);
if (DBA::isResult($base_image)) {
$Image = Photo::getImageForPhoto($base_image);
if (empty($Image)) {
throw new HTTPException\InternalServerErrorException();
}
if ($Image->isValid()) {
// If setting for the default profile, unset the profile photo flag from any other photos I own
DBA::update('photo', ['profile' => 0], ['uid' => local_user()]);
@ -188,6 +192,9 @@ class Crop extends BaseSettings
}
$Image = Photo::getImageForPhoto($photos[0]);
if (empty($Image)) {
throw new HTTPException\InternalServerErrorException();
}
$imagecrop = [
'resource-id' => $resource_id,