Skip to content

Commit c079b93

Browse files
authored
Fix a crash with Got accessing a non-existent request (#2391)
1 parent 3034c2f commit c079b93

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

source/core/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@ export default class Request extends Duplex implements RequestEvents<Request> {
490490
this._request.end((error?: Error | null) => { // eslint-disable-line @typescript-eslint/ban-types
491491
// The request has been destroyed before `_final` finished.
492492
// See https://github.com/nodejs/node/issues/39356
493-
if ((this._request as any)._writableState?.errored) {
493+
if ((this._request as any)?._writableState?.errored) {
494494
return;
495495
}
496496

0 commit comments

Comments
 (0)