Bug 1344604 - part2: Return empty DocumentFragment if the ConvertCueToDOMTree() return null. r=alwu

It is a regression of bug1307710, if something wrong during the ConvertCueToDOMTree() in vtt.jsm, we will get null ptr.

MozReview-Commit-ID: LSQrJIhBzRU

--HG--
extra : rebase_source : b0a2cf675f9288ddc9c264faaffcf97049c6c1c6
This commit is contained in:
bechen 2017-03-16 15:25:56 +08:00
parent 622a99a3ec
commit 098e6e6897

View File

@ -136,6 +136,9 @@ TextTrackCue::GetCueAsHTML()
nsCOMPtr<nsIDOMDocumentFragment> frag;
sParserWrapper->ConvertCueToDOMTree(window, this,
getter_AddRefs(frag));
if (!frag) {
return mDocument->CreateDocumentFragment();
}
return frag.forget().downcast<DocumentFragment>();
}