Skip to content

Commit

Permalink
Fix a crash with Got accessing a non-existent request (#2391)
Browse files Browse the repository at this point in the history
  • Loading branch information
johnlinp authored Nov 23, 2024
1 parent 3034c2f commit c079b93
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion source/core/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ export default class Request extends Duplex implements RequestEvents<Request> {
this._request.end((error?: Error | null) => { // eslint-disable-line @typescript-eslint/ban-types
// The request has been destroyed before `_final` finished.
// See https://github.com/nodejs/node/issues/39356
if ((this._request as any)._writableState?.errored) {
if ((this._request as any)?._writableState?.errored) {
return;
}

Expand Down

0 comments on commit c079b93

Please sign in to comment.