diff --git a/index.js b/index.js index 1a77c6f..afb72c4 100644 --- a/index.js +++ b/index.js @@ -270,7 +270,7 @@ function run_xhr(options) { xhr.body = xhr.responseText if(options.json) { - try { xhr.body = JSON.parse(xhr.responseText) } + try { xhr.body = xhr.responseText && JSON.parse(xhr.responseText) || undefined } catch (er) { return options.callback(er, xhr) } }