aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk/empathy-theme-adium.c
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:47:12 +0800
commite487926900bb21e5f0af642429d37ec8d90f4c3d (patch)
tree5e0718fc3092ab82a147422d3ba1760cc2dc0762 /libempathy-gtk/empathy-theme-adium.c
parent8b85d88959418fb575696a471b39071845fb79d8 (diff)
downloadgsoc2013-empathy-e487926900bb21e5f0af642429d37ec8d90f4c3d.tar
gsoc2013-empathy-e487926900bb21e5f0af642429d37ec8d90f4c3d.tar.gz
gsoc2013-empathy-e487926900bb21e5f0af642429d37ec8d90f4c3d.tar.bz2
gsoc2013-empathy-e487926900bb21e5f0af642429d37ec8d90f4c3d.tar.lz
gsoc2013-empathy-e487926900bb21e5f0af642429d37ec8d90f4c3d.tar.xz
gsoc2013-empathy-e487926900bb21e5f0af642429d37ec8d90f4c3d.tar.zst
gsoc2013-empathy-e487926900bb21e5f0af642429d37ec8d90f4c3d.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/empathy-theme-adium.c')
-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 8877a2796..c5d9d2090 100644
--- a/libempathy-gtk/empathy-theme-adium.c
+++ b/libempathy-gtk/empathy-theme-adium.c
@@ -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;