[empathy] account-settings: cope with g_regex_new returning NULL
- From: Guillaume Desmottes <gdesmott src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [empathy] account-settings: cope with g_regex_new returning NULL
- Date: Thu, 10 Feb 2011 12:23:09 +0000 (UTC)
commit 5324201651b4be5a164ab2f3af2f7d4a8348e4a9
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date: Thu Feb 10 13:21:09 2011 +0100
account-settings: cope with g_regex_new returning NULL
libempathy/empathy-account-settings.c | 10 +++++++++-
1 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/libempathy/empathy-account-settings.c b/libempathy/empathy-account-settings.c
index 1d2379f..6043922 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);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]