Check for existence of path before scanning it generating a lot of erros

pull/3765/head
Isaac Connor 2023-08-30 14:38:43 -04:00
parent 6331d79a73
commit 56999da3eb
1 changed files with 6 additions and 4 deletions

View File

@ -581,10 +581,12 @@ ZM\Debug("Figuring out height using width: $height = ($width * $oldHeight) / $ol
function find_video($path) {
# Look for other mp4s
$files = scandir($path);
foreach ($files as $file) {
if (preg_match('/.mp4$/i', $file)) {
return $file;
if (file_exists($path)) {
$files = scandir($path);
foreach ($files as $file) {
if (preg_match('/.mp4$/i', $file)) {
return $file;
}
}
}
}