Skip to content

Commit

Permalink
Fix crash in QWebPage::selectedHtml() when selectedRange is nullptr
Browse files Browse the repository at this point in the history
Change-Id: Ia618d5044ab0b4e8293c7d53de936b323982656c
  • Loading branch information
annulen committed Dec 28, 2017
1 parent 0325d51 commit 0e75f32
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Source/WebKit/qt/WebCoreSupport/QWebPageAdapter.cpp
Expand Up @@ -390,7 +390,10 @@ QString QWebPageAdapter::selectedText() const

QString QWebPageAdapter::selectedHtml() const
{
return page->focusController().focusedOrMainFrame().editor().selectedRange()->toHTML();
RefPtr<Range> range = page->focusController().focusedOrMainFrame().editor().selectedRange();
if (!range)
return QString();
return range->toHTML();
}

bool QWebPageAdapter::isContentEditable() const
Expand Down

0 comments on commit 0e75f32

Please sign in to comment.