From 24c8b3a4b704fad79ef88f0e3d44d6e6f9deaeb1 Mon Sep 17 00:00:00 2001 From: Sake Blok Date: Mon, 26 Nov 2007 09:10:37 +0000 Subject: Check if a packet is selected before trying to build a display filter based on the "selected" packet. Fixes bug 2020. svn path=/trunk/; revision=23596 --- gtk/menu.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'gtk/menu.c') diff --git a/gtk/menu.c b/gtk/menu.c index 7811b4c1bc..09a4d33783 100644 --- a/gtk/menu.c +++ b/gtk/menu.c @@ -368,16 +368,18 @@ conversation_cb(GtkWidget * w, gpointer data _U_, int action) gchar *filter; GtkWidget *filter_te; - /* create a filter-string based on the selected packet and action */ - filter = build_conversation_filter(action, TRUE); + if (cfile.finfo_selected) { + /* create a filter-string based on the selected packet and action */ + filter = build_conversation_filter(action, TRUE); - /* Run the display filter so it goes in effect - even if it's the - same as the previous display filter. */ - filter_te = OBJECT_GET_DATA(w, E_DFILTER_TE_KEY); - gtk_entry_set_text(GTK_ENTRY(filter_te), filter); - main_filter_packets(&cfile, filter, TRUE); + /* Run the display filter so it goes in effect - even if it's the + same as the previous display filter. */ + filter_te = OBJECT_GET_DATA(w, E_DFILTER_TE_KEY); + gtk_entry_set_text(GTK_ENTRY(filter_te), filter); + main_filter_packets(&cfile, filter, TRUE); - g_free(filter); + g_free(filter); + } } void @@ -388,7 +390,7 @@ colorize_conversation_cb(GtkWidget * w _U_, gpointer data _U_, int action) if( (action>>8) == 255 ) { color_filters_reset_tmp(); cf_colorize_packets(&cfile); - } else { + } else if (cfile.finfo_selected) { if( (action&0xff) == 0 ) { /* colorize_conversation_cb was called from the window-menu * or through an accelerator key. Try to build a conversation -- cgit v1.2.3