From f2d156097e02e5b0e5da665681e9c82a10f4c3d3 Mon Sep 17 00:00:00 2001 From: Andrew Li Date: Sun, 24 Jun 2018 14:45:20 -0500 Subject: [PATCH] Check if init exists before trying to access timeout --- fetch-polyfill.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fetch-polyfill.js b/fetch-polyfill.js index 7530cc7..a08028c 100644 --- a/fetch-polyfill.js +++ b/fetch-polyfill.js @@ -40,7 +40,7 @@ export default function fetchPolyfill (input, init) { var xhr = new XMLHttpRequest() /* @patch: timeout */ - if (init.timeout) { + if (init && init.timeout) { xhr.timeout = init.timeout; } /* @endpatch */