summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--backend/epub/epub-document.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/backend/epub/epub-document.c b/backend/epub/epub-document.c
index 52530f47..385d2fea 100644
--- a/backend/epub/epub-document.c
+++ b/backend/epub/epub-document.c
@@ -1201,7 +1201,13 @@ setup_index_from_navfile(gchar *tocpath)
GList *index = NULL;
open_xml_document(tocpath);
set_xml_root_node(NULL);
- xmlNodePtr nav = xml_get_pointer_to_node((xmlChar*)"nav",(xmlChar*)"id",(xmlChar*)"toc");
+ xmlNodePtr nav = xml_get_pointer_to_node((xmlChar*)"nav",(xmlChar*)"type",(xmlChar*)"toc");
+
+ if (nav == NULL) {
+ xml_free_doc();
+ return NULL;
+ }
+
xmlretval=NULL;
xml_parse_children_of_node(nav,(xmlChar*)"ol", NULL,NULL);
gchar *navdirend = g_strrstr(tocpath,"/");