diff options
author | Crispin Flowerday <gnome@flowerday.cx> | 2005-09-24 05:35:07 +0800 |
---|---|---|
committer | Crispin Flowerday <crispin@src.gnome.org> | 2005-09-24 05:35:07 +0800 |
commit | 7885000ddf06462e26d1c29dd16d0a3ebbd60319 (patch) | |
tree | 6285b5506c4754b8f4ebf7f4a55912c0c2ada149 /src | |
parent | de6e56efdb6053b813cc25b4e134f7b5be1db701 (diff) | |
download | gsoc2013-epiphany-7885000ddf06462e26d1c29dd16d0a3ebbd60319.tar.gz gsoc2013-epiphany-7885000ddf06462e26d1c29dd16d0a3ebbd60319.tar.zst gsoc2013-epiphany-7885000ddf06462e26d1c29dd16d0a3ebbd60319.zip |
Don't crash if the Authors key is missing, or there are no keys in the
2005-09-23 Crispin Flowerday <gnome@flowerday.cx>
* src/ephy-extensions-manager.c:
(ephy_extensions_manager_load_ini_string):
Don't crash if the Authors key is missing, or
there are no keys in the Loader section
Diffstat (limited to 'src')
-rw-r--r-- | src/ephy-extensions-manager.c | 47 |
1 files changed, 27 insertions, 20 deletions
diff --git a/src/ephy-extensions-manager.c b/src/ephy-extensions-manager.c index e571859ff..5eaf35801 100644 --- a/src/ephy-extensions-manager.c +++ b/src/ephy-extensions-manager.c @@ -711,13 +711,17 @@ ephy_extensions_manager_load_ini_string (EphyExtensionsManager *manager, list = g_key_file_get_string_list (key_file, "Epiphany Extension", "Authors", NULL, NULL); - for (i = 0 ; list[i]; i++ ) + if (list) { - einfo->authors = g_list_prepend (einfo->authors, - g_strstrip (g_strdup (list[i]))); + for (i = 0 ; list[i]; i++ ) + { + einfo->authors = g_list_prepend (einfo->authors, + g_strstrip (g_strdup (list[i]))); + } + g_strfreev (list); } + einfo->authors = g_list_reverse (einfo->authors); - g_strfreev (list); info->version = g_key_file_get_integer (key_file, "Epiphany Extension", @@ -725,28 +729,31 @@ ephy_extensions_manager_load_ini_string (EphyExtensionsManager *manager, /* Load the loader flags */ list = g_key_file_get_keys (key_file, "Loader", NULL, NULL); - for (i = 0 ; list[i]; i++ ) + + if (list) { - - char * value; - GQuark attr_quark = 0; + for (i = 0 ; list[i]; i++ ) + { + char * value; + GQuark attr_quark = 0; - value = g_key_file_get_string (key_file, "Loader", - list[i], NULL); + value = g_key_file_get_string (key_file, "Loader", + list[i], NULL); - if (strcmp (list[i], "Type") == 0) - { - info->loader_type = value; - continue; - } + if (strcmp (list[i], "Type") == 0) + { + info->loader_type = value; + continue; + } - attr_quark = g_quark_from_string (list[i]); + attr_quark = g_quark_from_string (list[i]); - g_datalist_id_set_data_full (&info->loader_attributes, - attr_quark, value, - (GDestroyNotify) g_free); - } + g_datalist_id_set_data_full (&info->loader_attributes, + attr_quark, value, + (GDestroyNotify) g_free); + } g_strfreev (list); + } g_key_file_free (key_file); |