Skip to content

Commit

Permalink
Partial improvement for #125. The null response check should be done …
Browse files Browse the repository at this point in the history
…before trying to assign the document url to the response.
  • Loading branch information
csvurt committed Sep 4, 2015
1 parent e3c1340 commit 970ca08
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/base/resourcemanager.js
Original file line number Diff line number Diff line change
Expand Up @@ -286,13 +286,13 @@ function setDocumentData(httpRequest, url, mimetype) {
response = JSON.parse(httpRequest.responseText);
} else if (cleanedMimetype.match(/xml/)) {
response = httpRequest.responseXML;
//Workaround for IE "bug" where external documents always report their document.URL as being identical to window.location.href
response._documentURL = url;
if (!response) {
XML3D.debug.logError("Invalid external XML document '" + httpRequest._url +
"': XML Syntax error");
"': XML Syntax error or the request did not succeed.");
return;
}
//Workaround for IE "bug" where external documents always report their document.URL as being identical to window.location.href
response._documentURL = url;
} else if (cleanedMimetype == "application/octet-stream" || mimetype == "text/plain; charset=x-user-defined") {
XML3D.debug.logError("Possibly wrong loading of resource " + url + ". Mimetype is " + mimetype + " but response is not an ArrayBuffer");
response = httpRequest.response;
Expand Down

0 comments on commit 970ca08

Please sign in to comment.