Skip to content

Commit

Permalink
Don't wrap failed fopen in checksum wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
Vincent Petry committed Mar 9, 2017
1 parent c826ea3 commit d7091b5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/private/Files/Storage/Wrapper/Checksum.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ class Checksum extends Wrapper {
*/
public function fopen($path, $mode) {
$stream = $this->getWrapperStorage()->fopen($path, $mode);
if (!is_resource($stream)) {
// don't wrap on error
return $stream;
}

$requirement = $this->getChecksumRequirement($path, $mode);

if ($requirement === self::PATH_NEW_OR_UPDATED) {
Expand Down Expand Up @@ -163,4 +168,4 @@ public function getMetaData($path) {

return $parentMetaData;
}
}
}

0 comments on commit d7091b5

Please sign in to comment.