Bug 1459701 - Don't crash if ContentParent::UnregisterRemoteFrame is called with a ContentParentId that doesn't exist; r?jimm
MozReview-Commit-ID: AUnuR6W2S5S
--- a/dom/ipc/ContentParent.cpp
+++ b/dom/ipc/ContentParent.cpp
@@ -4403,16 +4403,20 @@ ContentParent::NotifyUpdatedFonts()
ContentParent::UnregisterRemoteFrame(const TabId& aTabId,
const ContentParentId& aCpId,
bool aMarkedDestroying)
{
if (XRE_IsParentProcess()) {
ContentProcessManager* cpm = ContentProcessManager::GetSingleton();
ContentParent* cp = cpm->GetContentProcessById(aCpId);
+ if (!cp) {
+ return;
+ }
+
cp->NotifyTabDestroyed(aTabId, aMarkedDestroying);
ContentProcessManager::GetSingleton()->UnregisterRemoteFrame(aCpId, aTabId);
} else {
ContentChild::GetSingleton()->SendUnregisterRemoteFrame(aTabId, aCpId,
aMarkedDestroying);
}
}