[Xfce4-commits] <postler:master> Check if a path is selected when clicking messages

Christian Dywan noreply at xfce.org
Wed Jun 2 00:12:02 CEST 2010


Updating branch refs/heads/master
         to 8fc8ef80c6b2b2d4ba7b0612bacb41ef3963e81e (commit)
       from 5d97b83b2c795660f9df996edfc98df8a783f328 (commit)

commit 8fc8ef80c6b2b2d4ba7b0612bacb41ef3963e81e
Author: Christian Dywan <christian at twotoasts.de>
Date:   Tue Jun 1 22:37:57 2010 +0200

    Check if a path is selected when clicking messages

 postler/postler-messages.vala |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/postler/postler-messages.vala b/postler/postler-messages.vala
index 46a3f87..ecb9467 100644
--- a/postler/postler-messages.vala
+++ b/postler/postler-messages.vala
@@ -358,9 +358,9 @@ public class Postler.Messages : Gtk.TreeView {
     override bool button_press_event (Gdk.EventButton event) {
         if (event.type == Gdk.EventType.2BUTTON_PRESS) {
             GLib.List<Gtk.TreePath> paths = get_selection ().get_selected_rows (null);
-            Gtk.TreeIter sort_iter;
+            Gtk.TreeIter sort_iter = Gtk.TreeIter ();
             var path = paths.nth_data (0);
-            if (sort.get_iter (out sort_iter, path)) {
+            if (path != null && sort.get_iter (out sort_iter, path)) {
                 string location;
                 sort.get (sort_iter, Columns.LOCATION, out location, -1);
                 Postler.App.spawn_module ("content", location);
@@ -374,9 +374,9 @@ public class Postler.Messages : Gtk.TreeView {
             return base.button_release_event (event);
 
         GLib.List<Gtk.TreePath> paths = get_selection ().get_selected_rows (null);
-        Gtk.TreeIter sort_iter;
+        Gtk.TreeIter sort_iter = Gtk.TreeIter ();
         var path = paths.nth_data (0);
-        if (sort.get_iter (out sort_iter, path))
+        if (path != null && sort.get_iter (out sort_iter, path))
             display_message (sort_iter);
         return base.button_release_event (event);
     }



More information about the Xfce4-commits mailing list