Commit 412472c1 authored by Philip Chimento's avatar Philip Chimento Committed by Georges Basile Stavracas Neto
Browse files

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.
parent 1b812210
Pipeline #114425 passed with stages
in 4 minutes and 16 seconds
......@@ -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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment