From d06ce98d2f766097148c4ba5fc488bb6476b540d Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Tue, 13 Aug 2024 11:36:31 +0200 Subject: [PATCH] IniWriter: Avoid deprecation notice upon write errors --- library/Icinga/File/Ini/IniWriter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/Icinga/File/Ini/IniWriter.php b/library/Icinga/File/Ini/IniWriter.php index 1f470b006a..2131bc8825 100644 --- a/library/Icinga/File/Ini/IniWriter.php +++ b/library/Icinga/File/Ini/IniWriter.php @@ -69,7 +69,7 @@ public function __construct(Config $config, $filename, $filemode = 0660, $option */ public function render() { - if (file_exists($this->filename)) { + if ($this->filename !== null && file_exists($this->filename)) { $oldconfig = Config::fromIni($this->filename); $content = trim(file_get_contents($this->filename)); } else {