aboutsummaryrefslogtreecommitdiffstats
path: root/shell/e-folder-list.c
diff options
context:
space:
mode:
Diffstat (limited to 'shell/e-folder-list.c')
-rw-r--r--shell/e-folder-list.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/shell/e-folder-list.c b/shell/e-folder-list.c
index 3da34b7c57..fb199be2a9 100644
--- a/shell/e-folder-list.c
+++ b/shell/e-folder-list.c
@@ -467,13 +467,19 @@ e_folder_list_init (EFolderList *efl)
EFolderListItem *
e_folder_list_parse_xml (const char *xml)
{
- xmlDoc *doc;
+ xmlDoc *doc = NULL;
xmlNode *root;
xmlNode *node;
int i;
EFolderListItem *items;
- if (xml == NULL || *xml == 0) {
+ if (xml && *xml) {
+ doc = xmlParseMemory (xml, strlen (xml));
+ if (!doc)
+ g_warning ("malformed EFolderList xml");
+ }
+
+ if (!doc) {
items = g_new (EFolderListItem, 1);
items[0].uri = NULL;
items[0].physical_uri = NULL;
@@ -481,8 +487,6 @@ e_folder_list_parse_xml (const char *xml)
return items;
}
- doc = xmlParseMemory (xml, strlen (xml));
-
root = xmlDocGetRootElement (doc);
for (node = root->xmlChildrenNode, i = 0; node; node = node->next, i++)