aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2011-10-12 04:46:23 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2011-10-12 05:48:02 +0800
commit3b152eee315b32c0e8d844137843bb3f9a0c554b (patch)
tree25a3a1defdc56b918ae6ba69173052d1aea735e1 /libempathy-gtk
parentc7c9bf5beb4b2186a58c204fad97a375aa51f17c (diff)
downloadgsoc2013-empathy-3b152eee315b32c0e8d844137843bb3f9a0c554b.tar
gsoc2013-empathy-3b152eee315b32c0e8d844137843bb3f9a0c554b.tar.gz
gsoc2013-empathy-3b152eee315b32c0e8d844137843bb3f9a0c554b.tar.bz2
gsoc2013-empathy-3b152eee315b32c0e8d844137843bb3f9a0c554b.tar.lz
gsoc2013-empathy-3b152eee315b32c0e8d844137843bb3f9a0c554b.tar.xz
gsoc2013-empathy-3b152eee315b32c0e8d844137843bb3f9a0c554b.tar.zst
gsoc2013-empathy-3b152eee315b32c0e8d844137843bb3f9a0c554b.zip
Use default variant if we can't find any variants
We use to crash here trying to get the first element of an empty GPtrArray. https://bugzilla.gnome.org/show_bug.cgi?id=660586
Diffstat (limited to 'libempathy-gtk')
-rw-r--r--libempathy-gtk/empathy-theme-adium.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libempathy-gtk/empathy-theme-adium.c b/libempathy-gtk/empathy-theme-adium.c
index f81329b79..fde9d9295 100644
--- a/libempathy-gtk/empathy-theme-adium.c
+++ b/libempathy-gtk/empathy-theme-adium.c
@@ -1739,8 +1739,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;