test/source/xmltesttools.cxx | 1 + 1 file changed, 1 insertion(+) New commits: commit 88ca6d7834a9d710dc124ee845fd3c270e33b59a Author: Mike Kaganski <mike.kagan...@collabora.com> AuthorDate: Mon Apr 12 19:07:15 2021 +0200 Commit: Mike Kaganski <mike.kagan...@collabora.com> CommitDate: Mon Apr 12 21:52:19 2021 +0200
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.kagan...@collabora.com> diff --git a/test/source/xmltesttools.cxx b/test/source/xmltesttools.cxx index 45a57f5a22f6..fcd6ca5815ac 100644 --- a/test/source/xmltesttools.cxx +++ b/test/source/xmltesttools.cxx @@ -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)); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits