Add bulletproof null check to previous check-in
authorhyatt <hyatt@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 15 Apr 2005 10:05:57 +0000 (10:05 +0000)
committerhyatt <hyatt@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 15 Apr 2005 10:05:57 +0000 (10:05 +0000)
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@9016 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/khtml/khtmlview.cpp

index 0c21e6b97995b86d86186178487ccf4bf4777a43..e26842b3b98750b800946701c064cf0faf55f71d 100644 (file)
@@ -603,7 +603,7 @@ void KHTMLView::layout()
     ScrollBarMode hMode = d->hmode;
     ScrollBarMode vMode = d->vmode;
     
-    RenderObject* rootRenderer = document->documentElement()->renderer();
+    RenderObject* rootRenderer = document->documentElement() ? document->documentElement()->renderer() : 0;
     if (document->isHTMLDocument()) {
         NodeImpl *body = static_cast<HTMLDocumentImpl*>(document)->body();
         if (body && body->renderer()) {
@@ -618,7 +618,7 @@ void KHTMLView::layout()
             }
         }
     }
-    else
+    else if (rootRenderer)
         applyOverflowToViewport(rootRenderer, hMode, vMode); // XML/XHTML UAs use the root element.
 
 #ifdef INSTRUMENT_LAYOUT_SCHEDULING