fix error when not locked but with readable available

This commit is contained in:
cirospaciari
2023-09-07 16:43:24 -03:00
parent 3260fdd790
commit e9db9f32b1

View File

@@ -871,6 +871,15 @@ pub const Fetch = struct {
if (!success) {
const err = this.onReject(result);
err.ensureStillAlive();
if (this.readable_stream_ref.get()) |readable| {
readable.ptr.Bytes.onData(
.{
.err = .{ .JSValue = err },
},
bun.default_allocator,
);
return;
}
if (this.response.get()) |response_js| {
if (response_js.as(Response)) |response| {
const body = response.body;