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 {