Check if extension_init returns NULL and handle it
In the case where an extension ends up existing multiple times, it will fail to create an instance. We would rather see it in the list than crash.
This commit is contained in:
parent
a04bf24b5e
commit
b0191b69b0
1 changed files with 10 additions and 6 deletions
|
@ -1109,13 +1109,17 @@ midori_load_extensions (gpointer data)
|
||||||
(gpointer) &extension_init))
|
(gpointer) &extension_init))
|
||||||
{
|
{
|
||||||
extension = extension_init ();
|
extension = extension_init ();
|
||||||
/* Signal that we want the extension to load and save */
|
if (extension != NULL)
|
||||||
g_object_set_data_full (G_OBJECT (extension), "filename",
|
{
|
||||||
g_strdup (filename), g_free);
|
/* Signal that we want the extension to load and save */
|
||||||
if (midori_extension_is_prepared (extension))
|
g_object_set_data_full (G_OBJECT (extension), "filename",
|
||||||
midori_extension_get_config_dir (extension);
|
g_strdup (filename), g_free);
|
||||||
|
if (midori_extension_is_prepared (extension))
|
||||||
|
midori_extension_get_config_dir (extension);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
|
if (!extension)
|
||||||
{
|
{
|
||||||
extension = g_object_new (MIDORI_TYPE_EXTENSION,
|
extension = g_object_new (MIDORI_TYPE_EXTENSION,
|
||||||
"name", filename,
|
"name", filename,
|
||||||
|
|
Loading…
Reference in a new issue