0

I've been seeing this crash for a very small percent of users.

Fatal Exception: java.lang.NullPointerException
Attempt to invoke interface method 'boolean android.view.inputmethod.InputConnection.finishComposingText()' on a null object reference

called from android.view.inputmethod.InputConnectionWrapper.finishComposingText (InputConnectionWrapper.java:78)

The stack trace is all from Android system code, so I'm not sure how I'm triggering the crash. I think it has to do with how I've overridden the InputConnection on a WebView, but I'm not sure how exactly it's caused. Has anyone else seen this error or know how to fix it?

RyanCheu
  • 3,522
  • 5
  • 38
  • 47
  • Possible duplicate of [InputConnection.finishComposingText() NullPointerException](https://stackoverflow.com/questions/36498605/inputconnection-finishcomposingtext-nullpointerexception) – Farshid roohi May 15 '18 at 07:59

1 Answers1

1

This was caused by Google employees dog fooding a new version of the webview. onCreateInputConnection in InputConnectionWrapper sometimes returns null now and you need to check that before using it to instantiate RichTextInputConnection.

RyanCheu
  • 3,522
  • 5
  • 38
  • 47