forked from extern/Unexpected-Keyboard
Fix an unexplained crash encountered in the wild
For some reason, 'subtype' can be null. Perhaps because the keyboard is started before the IMM is ready.
This commit is contained in:
parent
90b9b0e399
commit
64e263a1af
@ -147,8 +147,16 @@ public class Keyboard2 extends InputMethodService
|
||||
else
|
||||
{
|
||||
InputMethodSubtype subtype = imm.getCurrentInputMethodSubtype();
|
||||
refreshSubtypeLayout(subtype);
|
||||
refreshAccentsOption(imm, subtype);
|
||||
if (subtype == null)
|
||||
{
|
||||
// On some rare cases, [subtype] is null.
|
||||
refreshSubtypeLegacyFallback();
|
||||
}
|
||||
else
|
||||
{
|
||||
refreshSubtypeLayout(subtype);
|
||||
refreshAccentsOption(imm, subtype);
|
||||
}
|
||||
}
|
||||
_config.shouldOfferSwitchingToProgramming =
|
||||
_config.programming_layout != -1 &&
|
||||
|
Loading…
Reference in New Issue
Block a user