[gitg] Improve code in exceptional situation



commit c2029dd6a2811c99a4c77b703a5ca5b52d024bbf
Author: Guilhem Bonnefille <guilhem bonnefille gmail com>
Date:   Tue Jul 28 22:31:02 2009 +0200

    Improve code in exceptional situation

 gitg/gitg-repository.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/gitg/gitg-repository.c b/gitg/gitg-repository.c
index 667f0ff..4ab5883 100644
--- a/gitg/gitg-repository.c
+++ b/gitg/gitg-repository.c
@@ -1272,7 +1272,8 @@ load_refs(GitgRepository *self)
 
 	GitgRef *working = gitg_repository_get_current_working_ref (self);
 
-	while ((buf = *buffer++) != NULL)
+	
+	while (buffer != NULL && (buf = *buffer++) != NULL)
 	{
 		// each line will look like <name> <hash>
 		gchar **components = g_strsplit(buf, " ", 3);



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