Skip to content

Commit a3d78cb

Browse files
authored
Remove lodash import
fix null pointer when headers are not passed
1 parent e3d86ee commit a3d78cb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ function fetch(...args:any):Promise {
223223

224224
// # 241 normalize null or undefined headers, in case nil or null string
225225
// pass to native context
226-
headers = Object.keys(headers).reduce((result, key) => {
226+
headers = headers && Object.keys(headers).reduce((result, key) => {
227227
result[key] = headers[key] || ''
228228
return result
229229
}, {});

0 commit comments

Comments
 (0)