Bug 977931 - return an error object even when restResponse.headers is null. r=spenrose

This commit is contained in:
Mark Hammond 2014-02-28 13:24:49 +11:00
parent ccf959aa2f
commit 744d2d3b48

View File

@ -71,7 +71,7 @@ this.HawkClient.prototype = {
code: restResponse.status,
errno: restResponse.status
};
let retryAfter = restResponse.headers["retry-after"];
let retryAfter = restResponse.headers && restResponse.headers["retry-after"];
retryAfter = retryAfter ? parseInt(retryAfter) : retryAfter;
if (retryAfter) {
errorObj.retryAfter = retryAfter;