Use "if" instead of "CHECK" to avoid crash at MayHaveHTMLLabel
Change-Id: Ia30df38b994ccf418967fc31f0ceb0dbadfda65d
Signed-off-by: fr.fang <fr.fang@samsung.com>
}
bool AXObjectCacheImpl::MayHaveHTMLLabel(const HTMLElement& elem) {
- CHECK(elem.GetDocument().Lifecycle().GetState() >=
- DocumentLifecycle::kLayoutClean)
- << "Unclean document at lifecycle " << elem.GetDocument().ToString();
- CHECK(relation_cache_);
+ if (!(elem.GetDocument().Lifecycle().GetState() >=
+ DocumentLifecycle::kLayoutClean)) {
+ LOG(ERROR) << "Unclean document at lifecycle "
+ << elem.GetDocument().ToString();
+ return false;
+ }
+
+ if (!relation_cache_)
+ return false;
// Return false if this type of element will not accept a <label for> label.
if (!elem.IsLabelable())