From 594324c1dc7d922eb7619d60dde13687989210a9 Mon Sep 17 00:00:00 2001 From: CaS Date: Thu, 22 May 2003 13:22:42 +0000 Subject: [PATCH] Minor xmpath fix git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@16768 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 6 ++++++ Source/Additions/GSXML.m | 13 +++++++++---- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0b49e66f1..f51209ca0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2003-05-22 Richard Frith-Macdonald + + * Source/Additions/GSXML.m: ([GSXPathContext-evaluateExpression:]) + Test for NULL return from libxml and return nil rather than trying + to dereference the null pointer. + 2003-05-19 Adam Fedor * Version 1.7.0. diff --git a/Source/Additions/GSXML.m b/Source/Additions/GSXML.m index 7c61edd04..e85b6767f 100644 --- a/Source/Additions/GSXML.m +++ b/Source/Additions/GSXML.m @@ -3348,10 +3348,15 @@ fatalErrorFunction(void *ctx, const char *msg, ...) } res = xmlXPathCompiledEval (comp, ((xmlXPathContext*)_lib)); - - result = [GSXPathObject _newWithNativePointer: res context: self]; - AUTORELEASE (result); - + if (res == NULL) + { + result = nil; + } + else + { + result = [GSXPathObject _newWithNativePointer: res context: self]; + AUTORELEASE (result); + } xmlXPathFreeCompExpr (comp); return result;