From: Kern Sibbald Date: Mon, 21 Jun 2004 13:46:11 +0000 (+0000) Subject: Fix Gnome crash on up/down arrow and no history X-Git-Tag: Release-1.35.1~96 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=239d4069556739e809de9353fa099f2443622f1b;p=bacula%2Fbacula Fix Gnome crash on up/down arrow and no history git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@1436 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/src/gnome2-console/callbacks.c b/bacula/src/gnome2-console/callbacks.c index 0de9987a6e..8d6c187839 100644 --- a/bacula/src/gnome2-console/callbacks.c +++ b/bacula/src/gnome2-console/callbacks.c @@ -153,21 +153,33 @@ on_entry1_key_press_event(GtkWidget *widget, GdkEventKey *event, gpointer user_d gtk_entry_set_text((GtkEntry *)entry1, ""); } else if (event->keyval == KEY_Up) { if (!hc) { + if (!hist) { + return FALSE; + } hc = g_list_last(hist); } else { hc = g_list_previous(hc); } if (!hc) { + if (!hist) { + return FALSE; + } hc = g_list_first(hist); } gtk_entry_set_text((GtkEntry *)entry1, (gchar *)hc->data); } else if (event->keyval == KEY_Down) { if (!hc) { + if (!hist) { + return FALSE; + } hc = g_list_first(hist); } else { hc = g_list_next(hc); } if (!hc) { + if (!hist) { + return FALSE; + } hc = g_list_last(hist); } gtk_entry_set_text((GtkEntry *)entry1, (gchar *)hc->data);