]> git.0d.be Git - empathy.git/commitdiff
Use default variant if we can't find any variants
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Tue, 11 Oct 2011 20:46:23 +0000 (16:46 -0400)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Tue, 11 Oct 2011 21:47:12 +0000 (17:47 -0400)
We use to crash here trying to get the first element of an empty GPtrArray.

https://bugzilla.gnome.org/show_bug.cgi?id=660586

libempathy-gtk/empathy-theme-adium.c

index 8877a2796f4ee72bcb355d19b000ddfcd330510b..c5d9d209052347c3275986af78c0697ebc233997 100644 (file)
@@ -1753,8 +1753,11 @@ adium_info_dup_path_for_variant (GHashTable *info,
                return g_strdup ("main.css");
        }
 
-       /* Verify the variant exists, fallback to the first one */
        variants = empathy_adium_info_get_available_variants (info);
+       if (variants->len == 0)
+               return g_strdup ("main.css");
+
+       /* Verify the variant exists, fallback to the first one */
        for (i = 0; i < variants->len; i++) {
                if (!tp_strdiff (variant, g_ptr_array_index (variants, i))) {
                        break;