From 5ed64d2be420cef284a822d8160cef80593aa271 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Mon, 12 Sep 2022 11:41:03 -0600 Subject: [PATCH] Prevent an error message if the directory doesn't exist. --- app/modules/resources/classes/modules.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/app/modules/resources/classes/modules.php b/app/modules/resources/classes/modules.php index 34398736d6..280846de14 100644 --- a/app/modules/resources/classes/modules.php +++ b/app/modules/resources/classes/modules.php @@ -809,10 +809,12 @@ if (!class_exists('modules')) { $xml .= " \n"; $xml .= ""; - $fout = fopen($_SESSION['switch']['conf']['dir']."/autoload_configs/modules.conf.xml","w"); - fwrite($fout, $xml); - unset($xml); - fclose($fout); + if (file_exists($_SESSION['switch']['conf']['dir'].'/autoload_configs')) { + $fout = fopen($_SESSION['switch']['conf']['dir']."/autoload_configs/modules.conf.xml","w"); + fwrite($fout, $xml); + unset($xml); + fclose($fout); + } //apply settings $_SESSION["reload_xml"] = true;