Author: abrander
Date: 2010-02-13 17:27:46 +0100 (Sat, 13 Feb 2010)
New Revision: 3215

Modified:
   trunk/plugins/output-facebook/output-facebook.c
Log:
Check return values in album_set_active().

Modified: trunk/plugins/output-facebook/output-facebook.c
===================================================================
--- trunk/plugins/output-facebook/output-facebook.c     2010-02-13 16:24:56 UTC 
(rev 3214)
+++ trunk/plugins/output-facebook/output-facebook.c     2010-02-13 16:27:46 UTC 
(rev 3215)
@@ -385,23 +385,22 @@
        GtkTreeIter iter;
        gchar *album_id;
 
-       gtk_tree_model_get_iter_first(model, &iter);
-
-       do
-       {
-               gtk_tree_model_get(model, &iter,
-                                  1, &album_id,
-                                  -1);
-
-               if (g_strcmp0(aid, album_id) == 0)
+       if (model && gtk_tree_model_get_iter_first(model, &iter))
+               do
                {
-                       gtk_combo_box_set_active_iter(combo, &iter);
+                       gtk_tree_model_get(model, &iter,
+                                          1, &album_id,
+                                          -1);
+
+                       if (g_strcmp0(aid, album_id) == 0)
+                       {
+                               gtk_combo_box_set_active_iter(combo, &iter);
+                               g_free(album_id);
+                               return;
+                       }
                        g_free(album_id);
-                       return;
                }
-               g_free(album_id);
-       }
-       while (gtk_tree_model_iter_next(model, &iter));
+               while (gtk_tree_model_iter_next(model, &iter));
 }
 
 static void


_______________________________________________
Rawstudio-commit mailing list
[email protected]
http://rawstudio.org/cgi-bin/mailman/listinfo/rawstudio-commit

Reply via email to