Bug 1258111 - Fix crash in CheckPolicy. r=billm, a=sylvestre
authorChristoph Kerschbaumer <ckerschb@christophkerschbaumer.com>
Thu, 23 Jun 2016 09:40:51 +0200
changeset 339696 f210e5d1a38d3ce9fb0be640a86c7119fb34c94a
parent 339695 afcdd85399636b518887cc17aedbda8cc1c1f197
child 339697 d80b5568e350fd49b51fe7cffc50fc609cbe6b4f
push id6249
push userjlund@mozilla.com
push dateMon, 01 Aug 2016 13:59:36 +0000
treeherdermozilla-beta@bad9d4f5bf7e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbillm, sylvestre
bugs1258111
milestone49.0a2
Bug 1258111 - Fix crash in CheckPolicy. r=billm, a=sylvestre
dom/base/nsContentPolicy.cpp
--- a/dom/base/nsContentPolicy.cpp
+++ b/dom/base/nsContentPolicy.cpp
@@ -155,17 +155,19 @@ nsContentPolicy::CheckPolicy(CPMethod   
         window = node->OwnerDoc()->GetWindow();
     } else {
         window = do_QueryInterface(requestingContext);
     }
 
     if (window) {
         nsCOMPtr<nsIDocShell> docShell = window->GetDocShell();
         nsCOMPtr<nsILoadContext> loadContext = do_QueryInterface(docShell);
-        loadContext->GetTopFrameElement(getter_AddRefs(topFrameElement));
+        if (loadContext) {
+          loadContext->GetTopFrameElement(getter_AddRefs(topFrameElement));
+        }
 
         MOZ_ASSERT(window->IsOuterWindow());
 
         if (topFrameElement) {
             nsCOMPtr<nsPIDOMWindowOuter> topWindow = window->GetScriptableTop();
             isTopLevel = topWindow == window;
         } else {
             // If we don't have a top frame element, then requestingContext is