]> git.meshlink.io Git - catta/commitdiff
minor avahi-discover-standalone fixes
authorLennart Poettering <lennart@poettering.net>
Thu, 25 Aug 2005 19:36:38 +0000 (19:36 +0000)
committerLennart Poettering <lennart@poettering.net>
Thu, 25 Aug 2005 19:36:38 +0000 (19:36 +0000)
git-svn-id: file:///home/lennart/svn/public/avahi/trunk@448 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe

avahi-discover-standalone/main.c

index 8c917f81a29413d1ec9f83b37f6c388b0de511c8..a1aec1075fb04a60daffe903de5e3ac125271ce5 100644 (file)
@@ -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);