summaryrefslogtreecommitdiff
path: root/libcaribou/xadapter.vala
diff options
context:
space:
mode:
Diffstat (limited to 'libcaribou/xadapter.vala')
-rw-r--r--libcaribou/xadapter.vala13
1 files changed, 11 insertions, 2 deletions
diff --git a/libcaribou/xadapter.vala b/libcaribou/xadapter.vala
index e786c66..22858b7 100644
--- a/libcaribou/xadapter.vala
+++ b/libcaribou/xadapter.vala
@@ -301,8 +301,17 @@ namespace Caribou {
out string variant_name) {
Xkl.ConfigRec config_rec = new Xkl.ConfigRec ();
config_rec.get_from_server (this.xkl_engine);
- group_name = config_rec.layouts[this.group];
- variant_name = config_rec.variants[this.group];
+
+ if (this.group < config_rec.layouts.length)
+ group_name = config_rec.layouts[this.group];
+ else
+ group_name = "";
+
+ if (this.group < config_rec.variants.length)
+ variant_name = config_rec.variants[this.group];
+ else
+ variant_name = "";
+
if (variant_name == null)
variant_name = "";