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

Crash on emoji selection #23

Open
alexisbronchart opened this issue Sep 23, 2024 · 1 comment · May be fixed by #24
Open

Crash on emoji selection #23

alexisbronchart opened this issue Sep 23, 2024 · 1 comment · May be fixed by #24

Comments

@alexisbronchart
Copy link

I'm often getting crashes when I search for an emoji and quickly select one. It helps if I wait some time before selecting.

Getting Fatal error: Index out of range when accessing searchResults?[indexPath.row] in ElegantEmojiPicker.swift :

public func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
    let selection = searchResults?[indexPath.row] ?? emojiSections[indexPath.section].emojis[indexPath.row]
    didSelectEmoji(selection)
}
@alexisbronchart
Copy link
Author

There seems to be a data race. As the capture below demonstrates, the execution of the the delegate method happens at a time the searchResults array was not updated yet in that scope.

Screenshot

@alexisbronchart alexisbronchart linked a pull request Oct 15, 2024 that will close this issue
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 a pull request may close this issue.

1 participant