keyboard: Nullify pointers if getting layout fails
It’s possible for get_layout()
to fail if the wrong type is specified,
in which case the layout
and variant
pointers will be left dangling.
This might fix an occasional bug where the keyboard layout isn’t saved correctly and warnings are spewed to the console about
g_variant_new_string: assertion 'g_utf8_validate (string, -1, NULL)' failed
Or it might not. I haven’t been able to reproduce that bug.
Signed-off-by: Philip Withnall withnall@endlessm.com