Fix crash when auto-capitalisation runs too soon

This is unexpected but happens once.
This commit is contained in:
Jules Aguillon 2022-07-30 18:19:28 +02:00
parent 4f5ce66347
commit bc8bcce82a

View File

@ -93,6 +93,8 @@ public class Keyboard2View extends View
/** Called by auto-capitalisation. */ /** Called by auto-capitalisation. */
public void set_shift_state(boolean state) public void set_shift_state(boolean state)
{ {
if (_keyboard == null)
return;
KeyValue shift = KeyValue.getKeyByName("shift"); KeyValue shift = KeyValue.getKeyByName("shift");
KeyboardData.Key key = _keyboard.findKeyWithValue(shift); KeyboardData.Key key = _keyboard.findKeyWithValue(shift);
if (key == null) if (key == null)