diff --git a/resources/classes/file.php b/resources/classes/file.php index e4cb3f4446..26c3c8f9ec 100644 --- a/resources/classes/file.php +++ b/resources/classes/file.php @@ -66,9 +66,11 @@ class file { if (!isset($voice)) { $voice = 'callie'; } //set the variables - $dir = $_SESSION['switch']['sounds']['dir'].'/'.$language.'/'.$dialect.'/'.$voice; - $rate = '8000'; - $files = $this->glob($dir.'/*/'.$rate, true); + if (!empty($_SESSION['switch']['sounds']['dir']) && file_exists($_SESSION['switch']['sounds']['dir'])) { + $dir = $_SESSION['switch']['sounds']['dir'].'/'.$language.'/'.$dialect.'/'.$voice; + $rate = '8000'; + $files = $this->glob($dir.'/*/'.$rate, true); + } //loop through the languages if (!empty($files)) {