diff --git a/accessible/src/base/nsTextAttrs.cpp b/accessible/src/base/nsTextAttrs.cpp index e311a8ebca8..6d9c3f1db00 100644 --- a/accessible/src/base/nsTextAttrs.cpp +++ b/accessible/src/base/nsTextAttrs.cpp @@ -306,7 +306,8 @@ nsTextAttrsMgr::FindEndOffsetInSubtree(const nsTPtrArray& aTextAttr return PR_FALSE; nsCOMPtr currElm(nsCoreUtils::GetDOMElementFor(aCurrNode)); - NS_ENSURE_STATE(currElm); + if (!currElm) + return PR_FALSE; // If the given text attribute (pointed by nsTextAttr object) changes its // value on the traversed element then fit the end of range. @@ -362,7 +363,8 @@ nsTextAttrsMgr::FindStartOffsetInSubtree(const nsTPtrArray& aTextAt } nsCOMPtr currElm(nsCoreUtils::GetDOMElementFor(aCurrNode)); - NS_ENSURE_STATE(currElm); + if (!currElm) + return PR_FALSE; // If the given text attribute (pointed by nsTextAttr object) changes its // value on the traversed element then fit the start of range.