diff options
author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2024-06-19 15:04:34 +0200 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2024-06-19 22:57:57 +0200 |
commit | fb226b66663bc0dd03e846ebfb5e74610316c6f4 (patch) | |
tree | 27811edcb8b7ed358df9274fc11cedc22de8aa89 | |
parent | 0b74a97428ab694446263bc13d6dbbd0ad2ccadc (diff) | |
download | arctica-greeter-fb226b66663bc0dd03e846ebfb5e74610316c6f4.tar.gz arctica-greeter-fb226b66663bc0dd03e846ebfb5e74610316c6f4.tar.bz2 arctica-greeter-fb226b66663bc0dd03e846ebfb5e74610316c6f4.zip |
src/arctica-greeter.vala: Handle get_state() return null gracefully in ArcticaGreeter.GetUser(), don't operate on null as if it was a string.
-rw-r--r-- | src/arctica-greeter.vala | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/arctica-greeter.vala b/src/arctica-greeter.vala index 7958ea4..2f8d40a 100644 --- a/src/arctica-greeter.vala +++ b/src/arctica-greeter.vala @@ -1701,9 +1701,9 @@ public class DBusServer : Object public string GetUser () throws GLib.DBusError, GLib.IOError { - string sUser = this.pGreeter.get_state ("last-user"); + var sUser = this.pGreeter.get_state ("last-user"); - return sUser; + return (sUser != null) ? sUser : "*other"; } public void SetLayout (string sLanguage, string sVariant) throws GLib.DBusError, GLib.IOError |