diff --git a/app/Http/Requests/ImageUploadRequest.php b/app/Http/Requests/ImageUploadRequest.php index 9f1d04b8e7..acf51970b5 100644 --- a/app/Http/Requests/ImageUploadRequest.php +++ b/app/Http/Requests/ImageUploadRequest.php @@ -121,13 +121,17 @@ class ImageUploadRequest extends Request } // If the user isn't uploading anything new but wants to delete their old image, do so - } elseif ($this->input('image_delete')=='1') { + } else { + \Log::debug('No image was passed - not sure what to do now.'); + if ($this->input('image_delete')=='1') { - try { - Storage::disk('public')->delete($path.'/'.$item->{$fieldname}); - $item->{$fieldname} = null; - } catch (\Exception $e) { - \Log::debug($e); + + try { + Storage::disk('public')->delete($path . '/' . $item->{$fieldname}); + $item->{$fieldname} = null; + } catch (\Exception $e) { + \Log::debug($e); + } } }