mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 696603: Handle null being passed to BlobBuilder.append. r=sicking
This commit is contained in:
parent
2b72a53735
commit
fcb45b0c7d
@ -372,7 +372,10 @@ nsDOMBlobBuilder::Append(const jsval& aData, JSContext* aCx)
|
||||
// Is it an object?
|
||||
if (JSVAL_IS_OBJECT(aData)) {
|
||||
JSObject* obj = JSVAL_TO_OBJECT(aData);
|
||||
NS_ASSERTION(obj, "Er, what?");
|
||||
if (!obj) {
|
||||
// We got passed null. Just do nothing.
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// Is it a Blob?
|
||||
nsCOMPtr<nsIDOMBlob> blob = do_QueryInterface(
|
||||
|
@ -37,6 +37,9 @@ ok(false, "NOT REACHED");
|
||||
ok(true, "an empty argument to append should throw");
|
||||
}
|
||||
|
||||
blobBuilder.append(null);
|
||||
// Yay we didn't crash.
|
||||
|
||||
blobBuilder.append("squiggle");
|
||||
let blob1 = blobBuilder.getBlob();
|
||||
ok(blob1 instanceof Blob, "getBlob should produce Blobs");
|
||||
|
Loading…
Reference in New Issue
Block a user