From 382f624d8374170d4e486cdb9e2b574182f45de1 Mon Sep 17 00:00:00 2001 From: Abdurahim Jauzee <7991920+Jauzee@users.noreply.github.com> Date: Fri, 11 May 2018 19:24:26 +0300 Subject: [PATCH] [ASTextNode] Check variables before calling delegate method #trivial (#898) --- Source/ASTextNode.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/ASTextNode.mm b/Source/ASTextNode.mm index 5452f96fd7..08f5f90bc8 100644 --- a/Source/ASTextNode.mm +++ b/Source/ASTextNode.mm @@ -1051,7 +1051,7 @@ static CGRect ASTextNodeAdjustRenderRectForShadowPadding(CGRect rendererRect, UI // Respond to long-press when it begins, not when it ends. if (longPressRecognizer.state == UIGestureRecognizerStateBegan) { - if ([_delegate respondsToSelector:@selector(textNode:longPressedLinkAttribute:value:atPoint:textRange:)]) { + if ([self _pendingLinkTap] && [_delegate respondsToSelector:@selector(textNode:longPressedLinkAttribute:value:atPoint:textRange:)]) { CGPoint touchPoint = [_longPressGestureRecognizer locationInView:self.view]; [_delegate textNode:self longPressedLinkAttribute:_highlightedLinkAttributeName value:_highlightedLinkAttributeValue atPoint:touchPoint textRange:_highlightRange]; }