Null dereference loading Blink layout test http/tests/misc/detach-during-notifyDone...
[WebKit-https.git] / Source / WebCore / loader / FrameLoader.cpp
index 921bbf189f92cb89049005496142f0de70ba0e05..523b30d95ba070161167b7f144fdfe66605fa54c 100644 (file)
@@ -2431,8 +2431,10 @@ void FrameLoader::checkLoadComplete()
         frames.append(*frame);
 
     // To process children before their parents, iterate the vector backwards.
         frames.append(*frame);
 
     // To process children before their parents, iterate the vector backwards.
-    for (unsigned i = frames.size(); i; --i)
-        frames[i - 1]->loader().checkLoadCompleteForThisFrame();
+    for (auto frame = frames.rbegin(); frame != frames.rend(); ++frame) {
+        if ((*frame)->page())
+            (*frame)->loader().checkLoadCompleteForThisFrame();
+    }
 }
 
 int FrameLoader::numPendingOrLoadingRequests(bool recurse) const
 }
 
 int FrameLoader::numPendingOrLoadingRequests(bool recurse) const