Skip to content

Commit

Permalink
Update AssetsAutoCompressComponent.php
Browse files Browse the repository at this point in the history
If file is empty, fread() is complaining about filesize.
  • Loading branch information
ovidiupop authored Jul 19, 2019
1 parent 73e17ee commit 3dc7e68
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/AssetsAutoCompressComponent.php
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,10 @@ public function readLocalFile($filePath)
if (!$file) {
throw new \Exception("Unable to open file: '{$filePath}'");
}
return fread($file, filesize($filePath));
$filesSize = filesize($filePath);
if($filesSize){
return fread($file, $filesSize);
}
fclose($file);
}
/**
Expand Down

0 comments on commit 3dc7e68

Please sign in to comment.