Bug 1308862 - Null check for the innerWindow. r=jwwang

MozReview-Commit-ID: DXrN3cnqV7U

--HG--
extra : rebase_source : a77e55182e9265ebec8a42d3770df7c41c69b286
This commit is contained in:
bechen 2016-10-12 17:26:20 +08:00
parent 3c1524e5e0
commit 2e9466d27e

View File

@ -126,11 +126,14 @@ NS_IMPL_ISUPPORTS(WindowDestroyObserver, nsIObserver);
HTMLTrackElement::HTMLTrackElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
: nsGenericHTMLElement(aNodeInfo)
, mLoadResourceDispatched(false)
, mWindowDestroyObserver(nullptr)
{
nsISupports* parentObject = OwnerDoc()->GetParentObject();
NS_ENSURE_TRUE_VOID(parentObject);
nsCOMPtr<nsPIDOMWindowInner> window = do_QueryInterface(parentObject);
mWindowDestroyObserver = new WindowDestroyObserver(this, window->WindowID());
if (window) {
mWindowDestroyObserver = new WindowDestroyObserver(this, window->WindowID());
}
}
HTMLTrackElement::~HTMLTrackElement()