fix the issue where an XPath contains an undefined function and the error is only exposed during evaluation. Should check the result pointer

github.com/moovweb/manhattan/issues/1070