Skip to content

Commit

Permalink
Refactor and add same fix for files replacement
Browse files Browse the repository at this point in the history
  • Loading branch information
ifox committed Jun 2, 2021
1 parent c531b28 commit 6b7c23e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/Http/Controllers/Admin/FileLibraryController.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class FileLibraryController extends ModuleController implements SignUploadListen
protected $defaultFilters = [
'search' => 'search',
'tag' => 'tag_id',
'unused' => 'unused'
'unused' => 'unused',
];

/**
Expand Down Expand Up @@ -315,6 +315,6 @@ public function uploadIsNotValid()
*/
private function shouldReplaceFile($id)
{
return $this->repository->whereId($id)->exists();
return isset($id) ? $this->repository->whereId($id)->exists() : false;
}
}
2 changes: 1 addition & 1 deletion src/Http/Controllers/Admin/MediaLibraryController.php
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,6 @@ private function getExtraMetadatas()
*/
private function shouldReplaceMedia($id)
{
return $id == 'null' ? false : $this->repository->whereId($id)->exists();
return isset($id) ? $this->repository->whereId($id)->exists() : false;
}
}

0 comments on commit 6b7c23e

Please sign in to comment.