]> source.dussan.org Git - nextcloud-server.git/commitdiff
Unregister enc stream wrapper for any exception 28604/head
authorVincent Petry <vincent@nextcloud.com>
Thu, 26 Aug 2021 08:23:03 +0000 (10:23 +0200)
committerVincent Petry <vincent@nextcloud.com>
Thu, 26 Aug 2021 12:20:04 +0000 (14:20 +0200)
This prevents side effects in tests by properly cleaning up
even with expected exceptions.

Signed-off-by: Vincent Petry <vincent@nextcloud.com>
lib/private/Files/Stream/Encryption.php

index 16d2ca3ce97f693c18a53316a518ac52dd00c168..fc75ead1e45b429a7682abe3e06560d6bab92e18 100644 (file)
@@ -213,7 +213,7 @@ class Encryption extends Wrapper {
                        } else {
                                $wrapped = fopen($protocol . '://', $mode, false, $context);
                        }
-               } catch (\BadMethodCallException $e) {
+               } catch (\Exception $e) {
                        stream_wrapper_unregister($protocol);
                        throw $e;
                }