| Index: Source/core/dom/Document.cpp
|
| diff --git a/Source/core/dom/Document.cpp b/Source/core/dom/Document.cpp
|
| index e9e7627af18eeb908b7a20e814ba60491f24d140..992c8401d322137335ad6b168cef8dee9264884a 100644
|
| --- a/Source/core/dom/Document.cpp
|
| +++ b/Source/core/dom/Document.cpp
|
| @@ -5444,10 +5444,11 @@ bool Document::hasFocus() const
|
| Page* page = this->page();
|
| if (!page)
|
| return false;
|
| - if (!page->focusController().isActive() || !page->focusController().isFocused() || !page->focusController().focusedFrame()->isLocalFrame())
|
| + if (!page->focusController().isActive() || !page->focusController().isFocused())
|
| return false;
|
| - if (LocalFrame* focusedFrame = toLocalFrame(page->focusController().focusedFrame())) {
|
| - if (focusedFrame->tree().isDescendantOf(frame()))
|
| + Frame* focusedFrame = page->focusController().focusedFrame();
|
| + if (focusedFrame && focusedFrame->isLocalFrame()) {
|
| + if (toLocalFrame(focusedFrame)->tree().isDescendantOf(frame()))
|
| return true;
|
| }
|
| return false;
|
|
|