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 e255731d1e
commit df34c67f0f

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;