Fix crash in fast/dom/dir-no-body.html
authoraroben <aroben@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 21 Jun 2007 02:34:16 +0000 (02:34 +0000)
committeraroben <aroben@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 21 Jun 2007 02:34:16 +0000 (02:34 +0000)
Reviewed by Mark.

* html/HTMLDocument.cpp:
(WebCore::HTMLDocument::createTokenizer): Don't assume we have a
Frame, since we won't if someone creates an HTMLDocument from JS.

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

WebCore/ChangeLog
WebCore/html/HTMLDocument.cpp

index 889111e3690497da73fe2b773302d8180492753e..31d9fb9cff6627254ffe42238b8614aad3bc109d 100644 (file)
@@ -1,3 +1,13 @@
+2007-06-20  Adam Roben  <aroben@apple.com>
+
+        Fix crash in fast/dom/dir-no-body.html
+
+        Reviewed by Mark.
+
+        * html/HTMLDocument.cpp:
+        (WebCore::HTMLDocument::createTokenizer): Don't assume we have a
+        Frame, since we won't if someone creates an HTMLDocument from JS.
+
 2007-06-20  Adam Roben  <aroben@apple.com>
 
         Land the new Inspector.
index 5e65d67cf7baa9ff2e89dd6df638feacd37a4d7e..7c68858a40a8462fc2c4327d319ad68384e428ad 100644 (file)
@@ -285,9 +285,10 @@ void HTMLDocument::releaseEvents()
 Tokenizer *HTMLDocument::createTokenizer()
 {
     bool reportErrors = false;
-    if (Page* page = m_frame->page())
-        if (InspectorController* controller = page->inspectorController())
-            reportErrors = controller->windowVisible();
+    if (m_frame)
+        if (Page* page = m_frame->page())
+            if (InspectorController* controller = page->inspectorController())
+                reportErrors = controller->windowVisible();
 
     return new HTMLTokenizer(this, reportErrors);
 }