Skip to content

Commit

Permalink
Unregister enc stream wrapper for any exception
Browse files Browse the repository at this point in the history
This prevents side effects in tests by properly cleaning up
even with expected exceptions.

Signed-off-by: Vincent Petry <[email protected]>
  • Loading branch information
PVince81 committed Aug 26, 2021
1 parent 60e4407 commit 9c6bbfa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/private/Files/Stream/Encryption.php
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ protected static function wrapSource($source, $context = [], $protocol = null, $
} else {
$wrapped = fopen($protocol . '://', $mode, false, $context);
}
} catch (\BadMethodCallException $e) {
} catch (\Exception $e) {
stream_wrapper_unregister($protocol);
throw $e;
}
Expand Down

0 comments on commit 9c6bbfa

Please sign in to comment.