fix: undefined reference to response.body when aborted (#1578)

This commit is contained in:
Krisi Ves 2022-06-09 03:55:02 -07:00 committed by GitHub
parent a92b5d5cf4
commit 1c5ed6b981
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -110,7 +110,9 @@ export default async function fetch(url, options_) {
});
fixResponseChunkedTransferBadEnding(request_, error => {
response.body.destroy(error);
if (response && response.body) {
response.body.destroy(error);
}
});
/* c8 ignore next 18 */