getXPathNode may return nullptr
E.g., when "Undefined namespace prefix" error is thrown Change-Id: I9dfcf761dc8463e2679fb41962502689c91cd2f7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113994 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
This commit is contained in:
parent
5b59d0b92f
commit
88ca6d7834
1 changed files with 1 additions and 0 deletions
|
@ -84,6 +84,7 @@ OUString XmlTestTools::getXPath(const xmlDocUniquePtr& pXmlDoc, const OString& r
|
|||
{
|
||||
CPPUNIT_ASSERT(pXmlDoc);
|
||||
xmlXPathObjectPtr pXmlObj = getXPathNode(pXmlDoc, rXPath);
|
||||
CPPUNIT_ASSERT(pXmlObj);
|
||||
xmlNodeSetPtr pXmlNodes = pXmlObj->nodesetval;
|
||||
CPPUNIT_ASSERT_EQUAL_MESSAGE(OString(OStringLiteral("In <") + pXmlDoc->name + ">, XPath '" + rXPath + "' number of nodes is incorrect").getStr(),
|
||||
1, xmlXPathNodeSetGetLength(pXmlNodes));
|
||||
|
|
Loading…
Reference in a new issue