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.
(cherry picked from commit 412472c16d
)
This commit is contained in:
parent
70631e9b23
commit
0f8e3f332c
1 changed files with 2 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue