From 3e8547ff1b3e030c4b337b4148937829dbfe9772 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 17 Jan 2011 23:11:51 -0600 Subject: [PATCH] ifcfg-rh: fix crash on ignored file change Don't crash when a file we don't care about changes. --- system-settings/plugins/ifcfg-rh/plugin.c | 34 +++++++++++------------ 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/system-settings/plugins/ifcfg-rh/plugin.c b/system-settings/plugins/ifcfg-rh/plugin.c index 24a4d115dc..f99348df9d 100644 --- a/system-settings/plugins/ifcfg-rh/plugin.c +++ b/system-settings/plugins/ifcfg-rh/plugin.c @@ -343,24 +343,24 @@ dir_changed (GFileMonitor *monitor, /* Given any ifcfg, keys, or routes file, get the ifcfg file path */ name = utils_get_ifcfg_path (path); g_free (path); - - connection = g_hash_table_lookup (priv->connections, name); - switch (event_type) { - case G_FILE_MONITOR_EVENT_DELETED: - PLUGIN_PRINT (IFCFG_PLUGIN_NAME, "removed %s.", name); - if (connection) - remove_connection (plugin, connection); - break; - case G_FILE_MONITOR_EVENT_CREATED: - case G_FILE_MONITOR_EVENT_CHANGES_DONE_HINT: - /* Update or new */ - connection_new_or_changed (plugin, name, connection); - break; - default: - break; + if (name) { + connection = g_hash_table_lookup (priv->connections, name); + switch (event_type) { + case G_FILE_MONITOR_EVENT_DELETED: + PLUGIN_PRINT (IFCFG_PLUGIN_NAME, "removed %s.", name); + if (connection) + remove_connection (plugin, connection); + break; + case G_FILE_MONITOR_EVENT_CREATED: + case G_FILE_MONITOR_EVENT_CHANGES_DONE_HINT: + /* Update or new */ + connection_new_or_changed (plugin, name, connection); + break; + default: + break; + } + g_free (name); } - - g_free (name); } static void