Skip to content

Commit 133600c

Browse files
authored
Merge pull request #146 from ardera/develop
fix handling of invalid keyboard config
2 parents d30e343 + ca2280f commit 133600c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/flutter-pi.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1958,7 +1958,7 @@ static int on_libinput_ready(sd_event_source *s, int fd, uint32_t revents, void
19581958
}
19591959
} else if (libinput_device_has_capability(device, LIBINPUT_DEVICE_CAP_KEYBOARD)) {
19601960
#if BUILD_TEXT_INPUT_PLUGIN || BUILD_RAW_KEYBOARD_PLUGIN
1961-
if (flutterpi.input.disable_text_input == false) {
1961+
if ((flutterpi.input.disable_text_input == false) && (flutterpi.input.keyboard_config != NULL)) {
19621962
data->keyboard_state = keyboard_state_new(flutterpi.input.keyboard_config, NULL, NULL);
19631963
}
19641964
#endif
@@ -2164,7 +2164,7 @@ static int on_libinput_ready(sd_event_source *s, int fd, uint32_t revents, void
21642164
} else if (type == LIBINPUT_EVENT_POINTER_AXIS) {
21652165

21662166
}
2167-
} else if (LIBINPUT_EVENT_IS_KEYBOARD(type) && !flutterpi.input.disable_text_input) {
2167+
} else if (LIBINPUT_EVENT_IS_KEYBOARD(type) && !flutterpi.input.disable_text_input && (data->keyboard_state != NULL)) {
21682168
#if BUILD_RAW_KEYBOARD_PLUGIN || BUILD_TEXT_INPUT_PLUGIN
21692169
struct keyboard_modifier_state mods;
21702170
enum libinput_key_state key_state;

0 commit comments

Comments
 (0)