Permalink
Browse files

Fix for when Content-Length header not present

  • Loading branch information...
1 parent 3989227 commit 78a2811ee9db28bd566427253c3e4fe8a9ac78b3 @ingemaradahl ingemaradahl committed May 21, 2012
Showing with 2 additions and 3 deletions.
  1. +2 −3 src/ResourceDepot.js
View
@@ -463,10 +463,9 @@ function loadJSON(file, callback) {
if (request.status == 404)
console.log("ERROR: file '" + file + "' does not exist!");
else {
- var len = parseInt(request.getResponseHeader("Content-Length"));
- if (request.responseText.length !== len) {
+ var len = request.getResponseHeader("Content-Length");
+ if (len && request.responseText.length !== parseInt(len)) {
console.log(len, request.responseText.length);
- // TODO
alert("An error occured while downloading Emberwind, please clear your cache and try again.");
}
else {

0 comments on commit 78a2811

Please sign in to comment.