Check that selection range count is not 0
Fixes: https://bugs.launchpad.net/midori/+bug/883157
This commit is contained in:
parent
f6d3c29be5
commit
cd8cb11ea2
1 changed files with 2 additions and 1 deletions
|
@ -4175,7 +4175,8 @@ midori_view_has_selection (MidoriView* view)
|
||||||
doc = webkit_web_view_get_dom_document (WEBKIT_WEB_VIEW (view->web_view));
|
doc = webkit_web_view_get_dom_document (WEBKIT_WEB_VIEW (view->web_view));
|
||||||
window = webkit_dom_document_get_default_view (doc);
|
window = webkit_dom_document_get_default_view (doc);
|
||||||
selection = webkit_dom_dom_window_get_selection (window);
|
selection = webkit_dom_dom_window_get_selection (window);
|
||||||
if (selection == NULL)
|
if (selection == NULL
|
||||||
|
|| webkit_dom_dom_selection_get_range_count (selection) == 0)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
range = webkit_dom_dom_selection_get_range_at (selection, 0, NULL);
|
range = webkit_dom_dom_selection_get_range_at (selection, 0, NULL);
|
||||||
|
|
Loading…
Reference in a new issue