aboutsummaryrefslogtreecommitdiffstats
path: root/mail/em-folder-tree-model.c
diff options
context:
space:
mode:
Diffstat (limited to 'mail/em-folder-tree-model.c')
-rw-r--r--mail/em-folder-tree-model.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/mail/em-folder-tree-model.c b/mail/em-folder-tree-model.c
index 7d174e8fbc..b0a5206d7f 100644
--- a/mail/em-folder-tree-model.c
+++ b/mail/em-folder-tree-model.c
@@ -339,8 +339,14 @@ em_folder_tree_model_load_state (EMFolderTreeModel *model, const char *filename)
if (model->state)
xmlFreeDoc (model->state);
- if ((model->state = e_xml_parse_file (filename)))
- return;
+ if ((model->state = e_xml_parse_file (filename)) != NULL) {
+ node = xmlDocGetRootElement (model->state);
+ if (!node || strcmp ((char *)node->name, "tree-state") != 0) {
+ /* it is not expected XML file, thus free it and use the default */
+ xmlFreeDoc (model->state);
+ } else
+ return;
+ }
/* setup some defaults - expand "Local Folders" and "Search Folders" */
model->state = xmlNewDoc ((const unsigned char *)"1.0");