From 34fa8474852c0efb0002dba6ad8daffbee1177d5 Mon Sep 17 00:00:00 2001 From: Christian Persch Date: Wed, 3 Dec 2003 13:05:31 +0000 Subject: Fix two crashers. 2003-12-03 Christian Persch * src/pdm-dialog.c: (pdm_cmd_delete_selection), (compare_cookies): Fix two crashers. --- src/pdm-dialog.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/pdm-dialog.c') diff --git a/src/pdm-dialog.c b/src/pdm-dialog.c index 4fa1066d0..df1002f23 100755 --- a/src/pdm-dialog.c +++ b/src/pdm-dialog.c @@ -236,7 +236,13 @@ pdm_cmd_delete_selection (PdmActionInfo *action) selection = gtk_tree_view_get_selection (GTK_TREE_VIEW(action->treeview)); llist = gtk_tree_selection_get_selected_rows (selection, &model); - + + if (llist == NULL) + { + /* nothing to delete, return early */ + return; + } + for (l = llist;l != NULL; l = l->next) { rlist = g_list_prepend (rlist, gtk_tree_row_reference_new @@ -446,8 +452,8 @@ compare_cookies (const EphyCookie *cookie1, g_return_val_if_fail (cookie1 != NULL || cookie2 != NULL, FALSE); return (strcmp (cookie1->domain, cookie2->domain) == 0 - && strcmp (cookie2->path, cookie2->path) == 0 - && strcmp (cookie2->name, cookie2->name) == 0); + && strcmp (cookie1->path, cookie2->path) == 0 + && strcmp (cookie1->name, cookie2->name) == 0); } static gboolean -- cgit