Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: node-fetch/node-fetch
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v2.6.8
Choose a base ref
...
head repository: node-fetch/node-fetch
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v2.6.9
Choose a head ref
  • 2 commits
  • 2 files changed
  • 2 contributors

Commits on Jan 23, 2023

  1. Prevent error when response is null (#1699)

    Fix for this error.
    
    TypeError: Cannot read properties of null (reading 'body')
    labnol authored Jan 23, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    0f1ebb0 View commit details

Commits on Jan 30, 2023

  1. Copy the full SHA
    70f592d View commit details
Showing with 4 additions and 2 deletions.
  1. +1 −1 browser.js
  2. +3 −1 src/index.js
2 changes: 1 addition & 1 deletion browser.js
Original file line number Diff line number Diff line change
@@ -17,7 +17,7 @@ module.exports = exports = globalObject.fetch;

// Needed for TypeScript and Webpack.
if (globalObject.fetch) {
exports.default = globalObject.fetch.bind(global);
exports.default = globalObject.fetch.bind(globalObject);
}

exports.Headers = globalObject.Headers;
4 changes: 3 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
@@ -135,7 +135,9 @@ export default function fetch(url, opts) {
return
}

destroyStream(response.body, err);
if (response && response.body) {
destroyStream(response.body, err);
}
});

/* c8 ignore next 18 */