aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2011-02-10 20:21:09 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2011-02-10 20:21:09 +0800
commit5324201651b4be5a164ab2f3af2f7d4a8348e4a9 (patch)
tree5ff0b31a4254d334ec6d80670282f1d16b142345
parentef8d5543ab390b62c99a0fc17e1ef30cdb08f6a5 (diff)
downloadgsoc2013-empathy-5324201651b4be5a164ab2f3af2f7d4a8348e4a9.tar
gsoc2013-empathy-5324201651b4be5a164ab2f3af2f7d4a8348e4a9.tar.gz
gsoc2013-empathy-5324201651b4be5a164ab2f3af2f7d4a8348e4a9.tar.bz2
gsoc2013-empathy-5324201651b4be5a164ab2f3af2f7d4a8348e4a9.tar.lz
gsoc2013-empathy-5324201651b4be5a164ab2f3af2f7d4a8348e4a9.tar.xz
gsoc2013-empathy-5324201651b4be5a164ab2f3af2f7d4a8348e4a9.tar.zst
gsoc2013-empathy-5324201651b4be5a164ab2f3af2f7d4a8348e4a9.zip
account-settings: cope with g_regex_new returning NULL
-rw-r--r--libempathy/empathy-account-settings.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/libempathy/empathy-account-settings.c b/libempathy/empathy-account-settings.c
index 1d2379fe5..604392202 100644
--- a/libempathy/empathy-account-settings.c
+++ b/libempathy/empathy-account-settings.c
@@ -1646,8 +1646,16 @@ empathy_account_settings_set_regex (EmpathyAccountSettings *settings,
{
EmpathyAccountSettingsPriv *priv = GET_PRIV (settings);
GRegex *regex;
+ GError *error = NULL;
+
+ regex = g_regex_new (pattern, 0, 0, &error);
+ if (regex == NULL)
+ {
+ g_warning ("Failed to create reg exp: %s", error->message);
+ g_error_free (error);
+ return;
+ }
- regex = g_regex_new (pattern, 0, 0, NULL);
g_hash_table_insert (priv->param_regexps, g_strdup (param), regex);
}