[gnome-control-center] region: Fix crash in keyboard layout population
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] region: Fix crash in keyboard layout population
- Date: Thu, 12 Sep 2019 18:14:54 +0000 (UTC)
commit 412472c16dcae02007a029e612ff6945b45f0a84
Author: Philip Chimento <philip endlessm com>
Date: Wed Sep 11 17:18:34 2019 -0700
region: Fix crash in keyboard layout population
The previous code would crash if 'variants' was null and 'layouts' had
more than one element in it.
panels/region/cc-region-panel.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/panels/region/cc-region-panel.c b/panels/region/cc-region-panel.c
index 39b1f9d7b..955d51fe2 100644
--- a/panels/region/cc-region-panel.c
+++ b/panels/region/cc-region-panel.c
@@ -1330,7 +1330,8 @@ add_input_sources_from_localed (CcRegionPanel *self)
n = 0;
for (i = 0; i < n && layouts[i][0]; i++) {
- g_autoptr(CcInputSourceXkb) source = cc_input_source_xkb_new (self->xkb_info, layouts[i],
variants[i]);
+ const char *variant = variants ? variants[i] : NULL;
+ g_autoptr(CcInputSourceXkb) source = cc_input_source_xkb_new (self->xkb_info, layouts[i],
variant);
add_input_row (self, CC_INPUT_SOURCE (source));
}
gtk_widget_set_visible (GTK_WIDGET (self->no_inputs_row), n == 0);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]