Most text-input related functions are callbacks; these don't need any checks. But a few functions are externally visible and are called to e.g. enable/disable IME. These functions must check that the text-input interface is available before calling its functions.
@Ordoviz I would appreciate if you could verify this stops the crashes.