diff options
author | Grace Kloba <klobag@google.com> | 2009-09-11 11:32:27 -0700 |
---|---|---|
committer | Grace Kloba <klobag@google.com> | 2009-09-11 11:32:27 -0700 |
commit | a8185118f3bc09b1874f02cd0b95a6397723f31b (patch) | |
tree | dbf9b98b4a19afb6b1b008926ab6a262711c3a0f /WebCore | |
parent | 8aafea2d231d98acf3fd26118f4b15e4ca1a1f11 (diff) | |
download | external_webkit-a8185118f3bc09b1874f02cd0b95a6397723f31b.zip external_webkit-a8185118f3bc09b1874f02cd0b95a6397723f31b.tar.gz external_webkit-a8185118f3bc09b1874f02cd0b95a6397723f31b.tar.bz2 |
Add more null checking to avoid the crash.
Diffstat (limited to 'WebCore')
-rw-r--r-- | WebCore/dom/Document.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/WebCore/dom/Document.cpp b/WebCore/dom/Document.cpp index c510669..e86cbc0 100644 --- a/WebCore/dom/Document.cpp +++ b/WebCore/dom/Document.cpp @@ -548,11 +548,12 @@ void Document::setDocType(PassRefPtr<DocumentType> docType) if (m_docType) m_docType->setDocument(this); #ifdef ANDROID_META_SUPPORT - if (!ownerElement() && m_docType->publicId().startsWith("-//wapforum//dtd xhtml mobile 1.", false)) { + if (m_docType && !ownerElement() + && m_docType->publicId().startsWith("-//wapforum//dtd xhtml mobile 1.", false)) { // fit mobile sites directly in the screen - frame()->settings()->setMetadataSettings("width", "device-width"); - FrameView* frameView = view(); - if (frameView) + if (Frame *f = frame()) + f->settings()->setMetadataSettings("width", "device-width"); + if (FrameView* frameView = view()) android::WebViewCore::getWebViewCore(frameView)->updateViewport(); } #endif |