[ASTextNode2] Check that rangeOut is non-nil before dereferencing (#1980)

rangeOut is a nullable parameter, but we are treating it as though it is always not null. Make sure it is not null before dereferencing it.
This commit is contained in:
ricky
2021-04-05 19:51:41 -07:00
committed by GitHub
parent 3776c893c7
commit de115e2000
+3 -1
View File
@@ -702,7 +702,9 @@ static NSArray *DefaultLinkAttributeNames() {
continue;
}
*rangeOut = NSIntersectionRange(visibleRange, effectiveRange);
if (rangeOut != NULL) {
*rangeOut = NSIntersectionRange(visibleRange, effectiveRange);
}
if (attributeNameOut != NULL) {
*attributeNameOut = attributeName;