[anjuta] git: Make sure that is a valid active branch in the log viewer combo when refreshing



commit 500c58901c8ee34213a982d8332c832b309ec77b
Author: James Liggett <jrliggett cox net>
Date:   Thu Jul 30 01:45:46 2009 -0700

    git: Make sure that is a valid active branch in the log viewer combo when refreshing
    
    Avoids crashes while initializing new repositories.

 plugins/git/git-log-dialog.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/plugins/git/git-log-dialog.c b/plugins/git/git-log-dialog.c
index 04cb21a..3823860 100644
--- a/plugins/git/git-log-dialog.c
+++ b/plugins/git/git-log-dialog.c
@@ -965,9 +965,13 @@ log_refresh (LogData *data)
 		return;
 
 	/* Don't refresh the log if the user isn't looking at the active 
-	 * branch */
-	gtk_combo_box_get_active_iter (log_branch_combo, &iter);
-	gtk_tree_model_get (log_branch_combo_model, &iter, 2, &active, -1);
+	 * branch. In some other cases, like when initializing a new repository, 
+	 * the user will be looking at no branch. Don't try to refresh in this case
+	 * either */
+	active = FALSE;
+	
+	if (gtk_combo_box_get_active_iter (log_branch_combo, &iter))
+		gtk_tree_model_get (log_branch_combo_model, &iter, 2, &active, -1);
 
 	if (!active)
 		return;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]