Skip to content
Snippets Groups Projects
Commit 7de911e4 authored by Demian Katz's avatar Demian Katz
Browse files

Do not fail when reading an empty file.

- More specific check on return value for file_get_contents().
parent b914b6fb
Branches
Tags
No related merge requests found
...@@ -69,7 +69,7 @@ class Writer ...@@ -69,7 +69,7 @@ class Writer
$this->filename = $filename; $this->filename = $filename;
if (null === $content) { if (null === $content) {
$this->content = file_get_contents($filename); $this->content = file_get_contents($filename);
if (!$this->content) { if (false === $this->content) {
throw new \Exception('Could not read ' . $filename); throw new \Exception('Could not read ' . $filename);
} }
} else if (is_array($content)) { } else if (is_array($content)) {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment