diff --git a/panel-plugin/xkb-config.c b/panel-plugin/xkb-config.c index 2871d96..27fe3ab 100644 --- a/panel-plugin/xkb-config.c +++ b/panel-plugin/xkb-config.c @@ -260,7 +260,12 @@ static gint xkb_config_get_current_group (void) { XklState* state = xkl_engine_get_current_state (config->engine); - return state->group; + g_assert(state->group >= 0 && state->group < config->group_count); + + if (G_LIKELY (state->group >= 0 && state->group < config->group_count)) + return state->group; + else + return 0; } gboolean