From b848ace10cfa7a6b7c18bd5cc25af53cc328e840 Mon Sep 17 00:00:00 2001 From: Giuliano Procida Date: Fri, 19 Jan 2024 09:03:43 +0000 Subject: Abigailed reader: compare against nullptr in a couple of places This is a bit clearer than just testing the pointer. PiperOrigin-RevId: 599756047 Change-Id: I899669bef0bfa808bec857bab01643656174f0a4 --- abigail_reader.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/abigail_reader.cc b/abigail_reader.cc index 835d75e..cdfc1c6 100644 --- a/abigail_reader.cc +++ b/abigail_reader.cc @@ -1157,7 +1157,7 @@ void Abigail::ProcessEnum(Id id, xmlNodePtr enumeration) { } xmlNodePtr underlying = Child(enumeration); - Check(underlying) << "enum-decl has no child elements"; + Check(underlying != nullptr) << "enum-decl has no child elements"; CheckName("underlying-type", underlying); const auto type = GetEdge(underlying); @@ -1306,7 +1306,7 @@ Document Read(const std::string& path, Metrics& metrics) { Id Read(Graph& graph, const std::string& path, Metrics& metrics) { const Document document = Read(path, metrics); xmlNodePtr root = xmlDocGetRootElement(document.get()); - Check(root) << "XML document has no root element"; + Check(root != nullptr) << "XML document has no root element"; return Abigail(graph).ProcessRoot(root); } -- cgit v1.2.3