Check for `NULL` on `keyboard_config` merge

We should not attempt to `strdup` `NULL`.
This commit is contained in:
raichoo 2020-09-14 12:39:18 +00:00
parent b084a678fb
commit 74f5249c33
1 changed files with 2 additions and 1 deletions

View File

@ -301,7 +301,8 @@ has_set_options(struct hikari_xkb_config *xkb_config)
}
#define MERGE(option) \
if (hikari_xkb_config_merge_##option(config_xkb, default_xkb)) { \
if (hikari_xkb_config_merge_##option(config_xkb, default_xkb) && \
default_xkb->option.value != NULL) { \
config_xkb->option.value = strdup(default_xkb->option.value); \
}