Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ASTextNode] Check variables before calling delegate method #trivial #898

Merged
merged 1 commit into from
May 11, 2018

Conversation

av0c0der
Copy link
Contributor

I found a bug in ASTextNode. If you do a long tap outside of the text area it'll crash.

I'm not sure about the fix, but I added a check for [self _pendingLinkTap] as for tappedLinkAttribute method and now it works correctly.

Reproduce

To reproduce a bug, please open demo project and do a long press on the right side of the text node.

@CLAassistant
Copy link

CLAassistant commented Apr 29, 2018

CLA assistant check
All committers have signed the CLA.

@av0c0der av0c0der changed the title Check variables before calling delegate method [ASTextNode] Check variables before calling delegate method Apr 29, 2018
@ghost
Copy link

ghost commented Apr 29, 2018

1 Warning
⚠️ Any source code changes should have an entry in CHANGELOG.md or have #trivial in their title.

Generated by 🚫 Danger

@av0c0der av0c0der changed the title [ASTextNode] Check variables before calling delegate method [ASTextNode] Check variables before calling delegate method #trivial Apr 29, 2018
Copy link
Contributor

@maicki maicki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jauzee Thanks for fixing!

I just looked into that and the problem is that we don't declare longPressedLinkAttribute: and the value: parameters as nullable. In this case it will crash on Swift's side as we will pass in a null if we don't check that the long press happened on a link.

The fix seems reasonable for me as we first check if there actually a long press happened on a link.

@nguyenhuy
Copy link
Member

nguyenhuy commented May 11, 2018

LGTM. Thanks, @jauzee!

@nguyenhuy nguyenhuy merged commit 382f624 into TextureGroup:master May 11, 2018
@av0c0der
Copy link
Contributor Author

@maicki @nguyenhuy it's a pleasure for me to make this little contribution to the great tool which helping me a lot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants