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

NullPointerException object Pattern #41

Open
Scorpionstvo opened this issue Apr 21, 2023 · 0 comments
Open

NullPointerException object Pattern #41

Scorpionstvo opened this issue Apr 21, 2023 · 0 comments

Comments

@Scorpionstvo
Copy link

Scorpionstvo commented Apr 21, 2023

Hello. I save a String from AXEmojiEditText to storage when I close the fragment. When I open this fragment again, I take the value from the database and set the text to AXEmojiEditText. The error occurs when emoji are present in the saved text. The error doesn't happen every time. I initialize emojiView before the method restoreDraft. Please help me solve this problem.

 private fun restoreDraft() {
        val draft = viewModel.getChat(getParams().id)?.draftMessage
        if (draft != null) `binding.chatInput.setText(draft)
    }

java.lang.NullPointerException: Attempt to invoke virtual method 'java.util.regex.Matcher java.util.regex.Pattern.matcher(java.lang.CharSequence)' on a null object reference

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

No branches or pull requests

1 participant