2010-11-20 Sam Magnuson <smagnuso@gmail.com>
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 21 Nov 2010 06:03:08 +0000 (06:03 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 21 Nov 2010 06:03:08 +0000 (06:03 +0000)
        Reviewed by Andreas Kling.

        [Qt] crash when attempting to add a JS object
        https://bugs.webkit.org/show_bug.cgi?id=49287

        * Api/qwebframe.cpp:
        (QWebFrame::addToJavaScriptWindowObject):

        Test: LayoutTests/fast/frames/sandboxed-iframe-plugins.html

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

WebKit/qt/Api/qwebframe.cpp
WebKit/qt/ChangeLog

index 203bd60..eb7a85f 100644 (file)
@@ -558,6 +558,10 @@ void QWebFrame::addToJavaScriptWindowObject(const QString &name, QObject *object
         qDebug() << "Warning: couldn't get window object";
         return;
     }
+    if (!root) {
+        qDebug() << "Warning: couldn't get root object";
+        return;
+    }
 
     JSC::ExecState* exec = window->globalExec();
 
index 83ced7f..4c428e9 100644 (file)
@@ -1,3 +1,15 @@
+2010-11-20  Sam Magnuson  <smagnuso@gmail.com>
+
+        Reviewed by Andreas Kling.
+
+        [Qt] crash when attempting to add a JS object
+        https://bugs.webkit.org/show_bug.cgi?id=49287
+
+        * Api/qwebframe.cpp:
+        (QWebFrame::addToJavaScriptWindowObject):
+
+        Test: LayoutTests/fast/frames/sandboxed-iframe-plugins.html
+
 2010-11-20  Sheriff Bot  <webkit.review.bot@gmail.com>
 
         Unreviewed, rolling out r72471.