From ffa44c461dca3b61904b3b2cfe12c9e25b637ec4 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 25 Aug 2005 19:36:38 +0000 Subject: [PATCH] minor avahi-discover-standalone fixes git-svn-id: file:///home/lennart/svn/public/avahi/trunk@448 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe --- avahi-discover-standalone/main.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/avahi-discover-standalone/main.c b/avahi-discover-standalone/main.c index 8c917f8..a1aec10 100644 --- a/avahi-discover-standalone/main.c +++ b/avahi-discover-standalone/main.c @@ -132,9 +132,10 @@ static void free_service(struct Service *s) { s->service_type->services = g_list_remove(s->service_type->services, s); - path = gtk_tree_row_reference_get_path(s->tree_ref); - gtk_tree_model_get_iter(GTK_TREE_MODEL(tree_store), &iter, path); - gtk_tree_path_free(path); + if ((path = gtk_tree_row_reference_get_path(s->tree_ref))) { + gtk_tree_model_get_iter(GTK_TREE_MODEL(tree_store), &iter, path); + gtk_tree_path_free(path); + } gtk_tree_store_remove(tree_store, &iter); @@ -256,6 +257,10 @@ static struct Service *get_service_on_cursor(void) { GtkTreeIter iter; gtk_tree_view_get_cursor(tree_view, &path, NULL); + + if (!path) + return NULL; + gtk_tree_model_get_iter(GTK_TREE_MODEL(tree_store), &iter, path); gtk_tree_model_get(GTK_TREE_MODEL(tree_store), &iter, 2, &s, -1); gtk_tree_path_free(path); -- 2.39.5