escape empty media-keys settings in the helper

close #28
This commit is contained in:
abakkk 2020-06-01 17:09:44 +02:00
parent 17c0da57a1
commit b45c86a5af
1 changed files with 2 additions and 0 deletions

View File

@ -1136,6 +1136,8 @@ var DrawingHelper = new Lang.Class({
if (!mediaKeysSettings.settings_schema.has_key(settingKey)) if (!mediaKeysSettings.settings_schema.has_key(settingKey))
continue; continue;
let shortcut = GS_VERSION < '3.33.0' ? mediaKeysSettings.get_string(settingKey) : mediaKeysSettings.get_strv(settingKey)[0]; let shortcut = GS_VERSION < '3.33.0' ? mediaKeysSettings.get_string(settingKey) : mediaKeysSettings.get_strv(settingKey)[0];
if (!shortcut)
continue;
let [keyval, mods] = Gtk.accelerator_parse(shortcut); let [keyval, mods] = Gtk.accelerator_parse(shortcut);
let hbox = new St.BoxLayout({ vertical: false }); let hbox = new St.BoxLayout({ vertical: false });
hbox.add_child(new St.Label({ text: _(MEDIA_KEYS_KEYS[settingKey]) })); hbox.add_child(new St.Label({ text: _(MEDIA_KEYS_KEYS[settingKey]) }));