diff --git a/app/Actions/Import/Exec.php b/app/Actions/Import/Exec.php index a01a12d84c3..11c3ac769e3 100644 --- a/app/Actions/Import/Exec.php +++ b/app/Actions/Import/Exec.php @@ -230,10 +230,7 @@ public function do( // TODO: Consider to use a modern OO-approach using [`DirectoryIterator`](https://www.php.net/manual/en/class.directoryiterator.php) and [`SplFileInfo`](https://www.php.net/manual/en/class.splfileinfo.php) /** @var string[] $files */ - $files = glob($path . '/*'); - if ($files === false) { - throw new FileOperationException('Could not list directory entries (' . $path . ')'); - } + $files = \Safe\glob($path . '/*'); $filesTotal = count($files); $filesCount = 0; @@ -308,7 +305,7 @@ public function do( Album::query() ->select(['albums.*']) ->join('base_albums', 'base_albums.id', '=', 'albums.id') - ->where('albums.parent_id', '=', $parentAlbum->id) + ->where('albums.parent_id', '=', $parentAlbum?->id) ->where('base_albums.title', '=', basename($dir)) ->get() ->first() :