Skip to content

Commit 491476f

Browse files
authored
Merge pull request #18 from mikehaertl/17-check-file-before-deletion
Issue #17 Check whether file exists before deleting
2 parents 0013625 + 758c9a5 commit 491476f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/File.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public function __construct($content, $suffix = null, $prefix = null, $directory
5656
*/
5757
public function __destruct()
5858
{
59-
if ($this->delete) {
59+
if ($this->delete && file_exists($this->_fileName)) {
6060
unlink($this->_fileName);
6161
}
6262
}

0 commit comments

Comments
 (0)