Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit 3468b7bc authored by Simon Chan's avatar Simon Chan
Browse files

fix: WrapWritableStream.close might close the inner stream twice

parent f3ddf0da
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -56,7 +56,7 @@ export class WrapWritableStream<T> extends WritableStream<T> {
            },
            abort: async (reason) => {
                await this.#writer.abort(reason);
                if ("close" in wrapper) {
                if (wrapper !== this.writable && "close" in wrapper) {
                    await wrapper.close?.();
                }
            },
@@ -66,7 +66,7 @@ export class WrapWritableStream<T> extends WritableStream<T> {
                // closing the outer stream first will make the inner stream incapable of
                // sending data in its `close` handler.
                await this.#writer.close();
                if ("close" in wrapper) {
                if (wrapper !== this.writable && "close" in wrapper) {
                    await wrapper.close?.();
                }
            },