Bug 1496839 - Avoid dereferencing null frame r=mattwoodrow
authorMiko Mynttinen <mikokm@gmail.com>
Thu, 18 Oct 2018 02:26:59 +0000
changeset 490248 8a1bcc91affb90fbdb0f36d5c45d0629e4b43622
parent 490247 3a18b352f6fb76d157dd54ea1cb8e1ba6c35d97f
child 490249 c645265aa5b827fac52c3692991cbd55558d5821
push id247
push userfmarier@mozilla.com
push dateSat, 27 Oct 2018 01:06:44 +0000
reviewersmattwoodrow
bugs1496839
milestone64.0a1
Bug 1496839 - Avoid dereferencing null frame r=mattwoodrow Differential Revision: https://phabricator.services.mozilla.com/D8882
layout/ipc/RenderFrameParent.cpp
--- a/layout/ipc/RenderFrameParent.cpp
+++ b/layout/ipc/RenderFrameParent.cpp
@@ -434,10 +434,12 @@ nsDisplayRemote::GetRemoteLayersId() con
 {
   MOZ_ASSERT(GetRenderFrameParent());
   return GetRenderFrameParent()->GetLayersId();
 }
 
 mozilla::layout::RenderFrameParent*
 nsDisplayRemote::GetRenderFrameParent() const
 {
-  return static_cast<nsSubDocumentFrame*>(Frame())->GetRenderFrameParent();
+  return mFrame
+    ? static_cast<nsSubDocumentFrame*>(mFrame)->GetRenderFrameParent()
+    : nullptr;
 }