diff options
Diffstat (limited to 'include/libxml/xpathInternals.h')
-rw-r--r-- | include/libxml/xpathInternals.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/include/libxml/xpathInternals.h b/include/libxml/xpathInternals.h index 88ee27c..dcd5243 100644 --- a/include/libxml/xpathInternals.h +++ b/include/libxml/xpathInternals.h @@ -40,7 +40,7 @@ extern "C" { */ #define xmlXPathSetError(ctxt, err) \ { xmlXPatherror((ctxt), __FILE__, __LINE__, (err)); \ - (ctxt)->error = (err); } + if ((ctxt) != NULL) (ctxt)->error = (err); } /** * xmlXPathSetArityError: @@ -294,6 +294,7 @@ XMLPUBFUN void * XMLCALL * Macro to check that the number of args passed to an XPath function matches. */ #define CHECK_ARITY(x) \ + if (ctxt == NULL) return; \ if (nargs != (x)) \ XP_ERROR(XPATH_INVALID_ARITY); |