Don't connect to a monitor that wasn't created in the first place
This commit is contained in:
parent
8ed02c1f88
commit
e5812d0478
1 changed files with 6 additions and 5 deletions
|
@ -917,14 +917,15 @@ midori_addons_new (MidoriAddonKind kind,
|
|||
monitor = g_file_monitor_directory (directory,
|
||||
G_FILE_MONITOR_NONE,
|
||||
NULL, &error);
|
||||
if (!monitor)
|
||||
{
|
||||
g_warning ("could not monitor %s: %s", g_file_get_parse_name (directory),
|
||||
error->message);
|
||||
g_error_free (error);
|
||||
}
|
||||
if (monitor)
|
||||
g_signal_connect (monitor, "changed",
|
||||
G_CALLBACK (midori_addons_directory_monitor_changed), addons);
|
||||
else
|
||||
{
|
||||
g_warning (_("Can't monitor folder '%s': %s"),
|
||||
g_file_get_parse_name (directory), error->message);
|
||||
g_error_free (error);
|
||||
}
|
||||
g_object_unref (directory);
|
||||
}
|
||||
g_slist_free (list);
|
||||
|
|
Loading…
Reference in a new issue