Bug 1181595 - Improve null checks in MessagePort::RemoveDocFromBFCache. r=smaug, a=kglazko
authorAndrea Marchesini <amarchesini@mozilla.com>
Thu, 09 Jul 2015 01:34:37 +0100
changeset 270241 8cfc3238ee5e0827b237a75e55cbd5367f97e4b1
parent 270240 9283521d2c15252e153a0ea04706e86debdc1a7c
child 270242 477a7f5576a309625f52859914182764fc8253aa
push id8194
push userryanvm@gmail.com
push dateMon, 13 Jul 2015 14:22:15 +0000
treeherdermozilla-aurora@016c863b9437 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug, kglazko
bugs1181595
milestone41.0a2
Bug 1181595 - Improve null checks in MessagePort::RemoveDocFromBFCache. r=smaug, a=kglazko
dom/messagechannel/MessagePort.cpp
--- a/dom/messagechannel/MessagePort.cpp
+++ b/dom/messagechannel/MessagePort.cpp
@@ -922,17 +922,19 @@ MessagePort::Observe(nsISupports* aSubje
 void
 MessagePort::RemoveDocFromBFCache()
 {
   if (!NS_IsMainThread()) {
     return;
   }
 
   nsPIDOMWindow* window = GetOwner();
-  MOZ_ASSERT(window);
+  if (!window) {
+    return;
+  }
 
   nsIDocument* doc = window->GetExtantDoc();
   if (!doc) {
     return;
   }
 
   nsCOMPtr<nsIBFCacheEntry> bfCacheEntry = doc->GetBFCacheEntry();
   if (!bfCacheEntry) {