]> git.sur5r.net Git - bacula/bacula/commitdiff
Fix Gnome crash on up/down arrow and no history
authorKern Sibbald <kern@sibbald.com>
Mon, 21 Jun 2004 13:46:11 +0000 (13:46 +0000)
committerKern Sibbald <kern@sibbald.com>
Mon, 21 Jun 2004 13:46:11 +0000 (13:46 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@1436 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/src/gnome2-console/callbacks.c

index 0de9987a6eb3e802adc6c6a8cbe94b7b9a684ec8..8d6c187839d760ac7bfbdb70cf931b4ab9b27699 100644 (file)
@@ -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);