commit 6936a2c82b6f3a935fe66ed162b43ece9fe4cb4f
parent 43e290527fd5d897c05b04c79e7e81f2ce428249
Author: Andrej Kacian <ticho@claws-mail.org>
Date: Mon, 19 Nov 2018 11:23:35 +0100
xml_parse_file() fails without assertion warning if xml_open_file() returns NULL.
This is not a programmer mistake, therefore an assertion
warning is not a good idea. xml_open_file() already shows
an assertion warning if necessary.
Diffstat:
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/common/xml.c b/src/common/xml.c
@@ -88,6 +88,7 @@ XMLFile *xml_open_file(const gchar *path)
newfile->fp = claws_fopen(path, "rb");
if (!newfile->fp) {
+ FILE_OP_ERROR(path, "fopen");
g_free(newfile);
return NULL;
}
@@ -161,7 +162,8 @@ GNode *xml_parse_file(const gchar *path)
GNode *node;
file = xml_open_file(path);
- cm_return_val_if_fail(file != NULL, NULL);
+ if (file == NULL)
+ return NULL;
xml_get_dtd(file);