WKBundleFrameCopyProvisionalURL crashes when there is no provisional loader
authorap@apple.com <ap@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 8 Aug 2013 19:22:31 +0000 (19:22 +0000)
committerap@apple.com <ap@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 8 Aug 2013 19:22:31 +0000 (19:22 +0000)
        https://bugs.webkit.org/show_bug.cgi?id=119587

        Reviewed by Darin Adler.

        * WebProcess/WebPage/WebFrame.cpp: (WebKit::WebFrame::provisionalURL): Added a null
        check, like we already have in WebFrame::url().

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@153839 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/WebPage/WebFrame.cpp

index 5595210..d90bcec 100644 (file)
@@ -1,3 +1,13 @@
+2013-08-08  Alexey Proskuryakov  <ap@apple.com>
+
+        WKBundleFrameCopyProvisionalURL crashes when there is no provisional loader
+        https://bugs.webkit.org/show_bug.cgi?id=119587
+
+        Reviewed by Darin Adler.
+
+        * WebProcess/WebPage/WebFrame.cpp: (WebKit::WebFrame::provisionalURL): Added a null
+        check, like we already have in WebFrame::url().
+
 2013-08-07  Antti Koivisto  <antti@apple.com>
 
         Try to fix EFL build.
index ae53d3c..3221fe1 100644 (file)
@@ -681,7 +681,11 @@ String WebFrame::provisionalURL() const
     if (!m_coreFrame)
         return String();
 
-    return m_coreFrame->loader()->provisionalDocumentLoader()->url().string();
+    DocumentLoader* provisionalDocumentLoader = m_coreFrame->loader()->provisionalDocumentLoader();
+    if (!provisionalDocumentLoader)
+        return String();
+
+    return provisionalDocumentLoader->url().string();
 }
 
 String WebFrame::suggestedFilenameForResourceWithURL(const KURL& url) const