Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix: undefined reference to response.body when aborted (#1578)
  • Loading branch information
krisives committed Jun 9, 2022
1 parent a92b5d5 commit 1c5ed6b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/index.js
Expand Up @@ -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 */
Expand Down

0 comments on commit 1c5ed6b

Please sign in to comment.