Skip to content

Commit 8bb0b9c

Browse files
ttgrulesJohn Hunt
andauthored
prevent unlink errors instead of attempting to suppress them (#48)
even with @, unlink still throws warnings if the file is not found, so we need to check file existence before trying to unlink it Co-authored-by: John Hunt <[email protected]>
1 parent 34b3efa commit 8bb0b9c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Spreadsheet/Excel/Writer/Worksheet.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -774,7 +774,7 @@ public function getData($cleanup = true)
774774
fclose($this->_filehandle);
775775
$this->_filehandle = '';
776776
}
777-
@unlink($this->_tmp_file);
777+
file_exists($this->_tmp_file) && @unlink($this->_tmp_file);
778778
$this->_tmp_file = '';
779779
$this->_using_tmpfile = false;
780780
$this->_datasize = 0;

0 commit comments

Comments
 (0)