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

MozReview-Commit-ID: DXrN3cnqV7U
This commit is contained in:
bechen
2016-10-12 17:26:20 +08:00
parent 82cf47929c
commit 4159bc7f3e

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()