mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-01-11 09:48:40 +00:00
Handle wrong path
This commit is contained in:
parent
0f19264e86
commit
1553e1f28e
|
|
@ -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));
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user