[Xfce4-commits] <midori:master> Check that selection range count is not 0

Christian Dywan noreply at xfce.org
Fri Oct 28 23:18:01 CEST 2011


Updating branch refs/heads/master
         to cd8cb11ea2ef415543345db73dd7effb3f5aaa4b (commit)
       from f6d3c29be5297b81f5d9f385d6290bcddbf6bc24 (commit)

commit cd8cb11ea2ef415543345db73dd7effb3f5aaa4b
Author: Christian Dywan <christian at twotoasts.de>
Date:   Fri Oct 28 23:12:40 2011 +0200

    Check that selection range count is not 0
    
    Fixes: https://bugs.launchpad.net/midori/+bug/883157

 midori/midori-view.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/midori/midori-view.c b/midori/midori-view.c
index 413fdf5..0070111 100644
--- a/midori/midori-view.c
+++ b/midori/midori-view.c
@@ -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);


More information about the Xfce4-commits mailing list