fix_selectedHtml_segfault
authorDebian Qt/KDE Maintainers <debian-qt-kde@lists.debian.org>
Sat, 9 Dec 2017 00:03:30 +0000 (00:03 +0000)
committerPeter Michael Green <plugwash@raspbian.org>
Sat, 9 Dec 2017 00:03:30 +0000 (00:03 +0000)
Gbp-Pq: Name fix_selectedHtml_segfault.diff

Source/WebKit/qt/WebCoreSupport/QWebPageAdapter.cpp

index ab9fb13821e1b749233ebfa5a4b6359a85b33756..6cf8df378fe1b21defac60c25a47e57a944e2bc1 100644 (file)
@@ -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