[evolution/wip/webkit-composer: 252/262] When the is no selection in composer don't try to process it.



commit 6776a7ddba5dffb8a527e463cf376dd7b5e67be6
Author: Tomas Popela <tpopela redhat com>
Date:   Fri Oct 11 13:51:58 2013 +0200

    When the is no selection in composer don't try to process it.

 e-util/e-editor-selection.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/e-util/e-editor-selection.c b/e-util/e-editor-selection.c
index 5342bf9..a7c97aa 100644
--- a/e-util/e-editor-selection.c
+++ b/e-util/e-editor-selection.c
@@ -123,12 +123,15 @@ editor_selection_get_current_range (EEditorSelection *selection)
                goto exit;
 
        dom_selection = webkit_dom_dom_window_get_selection (window);
+       if (!WEBKIT_DOM_IS_DOM_SELECTION (dom_selection))
+               goto exit;
+
        if (webkit_dom_dom_selection_get_range_count (dom_selection) < 1)
                goto exit;
 
        range = webkit_dom_dom_selection_get_range_at (dom_selection, 0, NULL);
 
-exit:
+ exit:
        g_object_unref (editor_widget);
 
        return range;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]