Bug 750023 - Add a null check in nsXMLHttpRequest::CreatePartialBlob. r=smaug

This commit is contained in:
Masatoshi Kimura 2012-04-30 15:49:15 -07:00
parent b7932b3e66
commit 799eae8b67
3 changed files with 29 additions and 0 deletions

View File

@ -107,3 +107,4 @@ load 713417.html
load 713417-2.html
load 715056.html
load 741163-1.html
HTTP(..) load xhr_abortinprogress.html

View File

@ -0,0 +1,23 @@
<!DOCTYPE html>
<html class="reftest-wait">
<meta charset=UTF-8>
<script>"use strict";
(function(){
var req = new XMLHttpRequest();
req.open('GET', '?' + Date.now());
req.responseType = 'moz-blob';
var b = null;
req.onprogress = function(e) {
b = req.response;
};
req.onreadystatechange = function(e) {
if (req.readyState == 3) {
req.abort();
}
if (req.readyState == 4) {
document.documentElement.removeAttribute('class');
}
};
req.send();
})();
</script>

View File

@ -1033,6 +1033,11 @@ nsXMLHttpRequest::CreatePartialBlob()
return NS_OK;
}
// mBuilder can be null if the request has been canceled
if (!mBuilder) {
return NS_OK;
}
nsCAutoString contentType;
if (mLoadTotal == mLoadTransferred) {
mChannel->GetContentType(contentType);