From 1553e1f28efb0dd870c32d52fe0572bea8b3f8ed Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Sat, 1 Apr 2017 13:58:26 +0200 Subject: [PATCH] Handle wrong path --- Module/InfoManager.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Module/InfoManager.php b/Module/InfoManager.php index a548c5c25..33a66d8e4 100644 --- a/Module/InfoManager.php +++ b/Module/InfoManager.php @@ -88,8 +88,8 @@ class InfoManager */ public function load() /* : void */ { - if (!file_exists($this->path)) { - throw new PathException($this->path); + if ($this->path === false || !file_exists($this->path)) { + throw new PathException((string) $this->path); } $this->info = json_decode(file_get_contents($this->path), true); @@ -105,8 +105,8 @@ class InfoManager */ public function update() /* : void */ { - if (!file_exists($this->path)) { - throw new PathException($this->path); + if ($this->path === false || !file_exists($this->path)) { + throw new PathException((string) $this->path); } file_put_contents($this->path, json_encode($this->info, JSON_PRETTY_PRINT));