diff --git a/src/Cards/UserCard.vala b/src/Cards/UserCard.vala index ea9742579..823a101a8 100644 --- a/src/Cards/UserCard.vala +++ b/src/Cards/UserCard.vala @@ -434,6 +434,18 @@ public class Greeter.UserCard : Greeter.BaseCard { settings.set_value ("xkb-options", options); } + /* + * When we get string typed settings from our settings daemon account service we might get a null value. + * In this case we reset the value to avoid criticals and unwanted behaviour. + */ + private void set_or_reset_settings_key (GLib.Settings settings, string key, GLib.Variant? value) { + if (value != null) { + settings.set_value (key, value); + } else { + settings.reset (key); + } + } + private void set_mouse_touchpad_settings () { var mouse_settings = new GLib.Settings ("org.gnome.desktop.peripherals.mouse"); mouse_settings.set_boolean ("left-handed", settings_act.left_handed); @@ -461,9 +473,9 @@ public class Greeter.UserCard : Greeter.BaseCard { interface_settings.set_value ("cursor-size", settings_act.cursor_size); interface_settings.set_value ("locate-pointer", settings_act.locate_pointer); interface_settings.set_value ("text-scaling-factor", settings_act.text_scaling_factor); - interface_settings.set_value ("document-font-name", settings_act.document_font_name); - interface_settings.set_value ("font-name", settings_act.font_name); - interface_settings.set_value ("monospace-font-name", settings_act.monospace_font_name); + set_or_reset_settings_key (interface_settings, "document-font-name", settings_act.document_font_name); + set_or_reset_settings_key (interface_settings, "font-name", settings_act.font_name); + set_or_reset_settings_key (interface_settings, "monospace-font-name", settings_act.monospace_font_name); var touchscreen_settings = new GLib.Settings ("org.gnome.settings-daemon.peripherals.touchscreen"); touchscreen_settings.set_boolean ("orientation-lock", settings_act.orientation_lock);