Skip to content

Commit 5167156

Browse files
committed
Avoid a fatal error when the dir does not exist
1 parent 5d0df4e commit 5167156

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

server/lib/classes/backup.inc.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -856,6 +856,10 @@ protected static function get_files($directory, $prefix_list = null, $endings_li
856856
if (is_null($endings_list))
857857
$endings_list = $default_endings_list;
858858

859+
if (!is_dir($directory)) {
860+
return array();
861+
}
862+
859863
$dir_handle = dir($directory);
860864
$files = array();
861865
while (false !== ($entry = $dir_handle->read())) {

0 commit comments

Comments
 (0)