Commit 01467168 authored by Aaron Wells's avatar Aaron Wells
Browse files

Make the JSON request handler better able to handle malformed responses

Bug 1318432

Change-Id: I161df25067515a4c85b7058df7b2e7dbebe32a33
parent 57035b28
......@@ -249,7 +249,17 @@ function sendjsonrequest(script, data, rtype, successcallback, errorcallback, qu
d.addCallbacks(function (result) {
document.documentElement.style.cursor = '';
var data = evalJSONRequest(result);
var data;
try {
data = jQuery.parseJSON(result.responseText);
}
catch (e) {
logError('sendjsonrequest() received invalid JSON');
processingStop();
errorcallback();
return;
}
var errtype = false;
if (!data.error) {
errtype = 'ok';
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment