libaurum: check nullptr with rawHandler 85/278485/1
authorHosang Kim <hosang12.kim@samsung.com>
Thu, 21 Jul 2022 05:10:21 +0000 (14:10 +0900)
committerHosang Kim <hosang12.kim@samsung.com>
Thu, 21 Jul 2022 05:10:21 +0000 (14:10 +0900)
Change-Id: I5a64588645bbd0357b6f8fb2269ea8281443eb33

libaurum/src/AurumXML.cc
libaurum/src/Comparer.cc

index e90790e..fe1e0bf 100644 (file)
@@ -79,7 +79,7 @@ void AurumXML::traverse(xml_node element, std::shared_ptr<AccessibleNode> node)
     int childCnt = node->getChildCount();
     for (int i = 0; i < childCnt; i++) {
         std::shared_ptr<AccessibleNode> childNode = node->getChildAt(i);
-        if (childNode == nullptr) continue;
+        if (childNode->getRawHandler() == nullptr) continue;
 
         xml_node childElement = element.append_child("");
         traverse(childElement, childNode);
index 9bbf841..517f05f 100644 (file)
@@ -103,7 +103,7 @@ std::vector<std::shared_ptr<AccessibleNode>> Comparer::findObjects(
         int childCnt = root->getChildCount();
         for (int i = 0; i < childCnt; i++) {
             std::shared_ptr<AccessibleNode> childNode = root->getChildAt(i);
-            if (childNode == nullptr) continue;
+            if (childNode->getRawHandler() == nullptr) continue;
 
             std::vector<std::shared_ptr<AccessibleNode>> childret =
                 findObjects(childNode, i, depth + 1, partialMatches);