diff --git a/lib/private/Files/Stream/Encryption.php b/lib/private/Files/Stream/Encryption.php index 007ef6f3560..e1233e76b93 100644 --- a/lib/private/Files/Stream/Encryption.php +++ b/lib/private/Files/Stream/Encryption.php @@ -212,7 +212,7 @@ class Encryption extends Wrapper { } else { $wrapped = fopen($protocol . '://', $mode, false, $context); } - } catch (\BadMethodCallException $e) { + } catch (\Exception $e) { stream_wrapper_unregister($protocol); throw $e; }