]> spindle.queued.net Git - midori/commitdiff
Check that selection range count is not 0
authorChristian Dywan <christian@twotoasts.de>
Fri, 28 Oct 2011 21:12:40 +0000 (23:12 +0200)
committerChristian Dywan <christian@twotoasts.de>
Fri, 28 Oct 2011 21:14:25 +0000 (23:14 +0200)
Fixes: https://bugs.launchpad.net/midori/+bug/883157
midori/midori-view.c

index 413fdf53324912e3bbb2e3171d80dea7061d2d9a..00701110c90d342bb4d2c58cb337805d838ffa70 100644 (file)
@@ -4175,7 +4175,8 @@ midori_view_has_selection (MidoriView* view)
     doc = webkit_web_view_get_dom_document (WEBKIT_WEB_VIEW (view->web_view));
     window = webkit_dom_document_get_default_view (doc);
     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;
 
     range = webkit_dom_dom_selection_get_range_at (selection, 0, NULL);