diff options
author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2024-06-17 11:48:18 +0200 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2024-06-18 08:48:10 +0200 |
commit | 7e692b9d601d975eadb6c7814b983743ad26c9be (patch) | |
tree | 1c6abaffe8f53f114964cd6e72e22323ce73aa67 /src/arctica-greeter.vala | |
parent | 8bc357f3a447fa0bc748d9a3bc1238a8f903c15d (diff) | |
download | arctica-greeter-7e692b9d601d975eadb6c7814b983743ad26c9be.tar.gz arctica-greeter-7e692b9d601d975eadb6c7814b983743ad26c9be.tar.bz2 arctica-greeter-7e692b9d601d975eadb6c7814b983743ad26c9be.zip |
src/arctica-greeter.vala: Only load state file if it already exists.
Diffstat (limited to 'src/arctica-greeter.vala')
-rw-r--r-- | src/arctica-greeter.vala | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/arctica-greeter.vala b/src/arctica-greeter.vala index c07665c..684c368 100644 --- a/src/arctica-greeter.vala +++ b/src/arctica-greeter.vala @@ -105,14 +105,19 @@ public class ArcticaGreeter : Object state_file = Path.build_filename (state_dir, state_file_name); state = new KeyFile (); - try - { - state.load_from_file (state_file, KeyFileFlags.NONE); + if (FileUtils.test (state_file, FileTest.EXISTS)) { + try + { + state.load_from_file (state_file, KeyFileFlags.NONE); + } + catch (Error e) + { + if (!(e is FileError.NOENT)) + warning ("Failed to load state from %s: %s\n", state_file, e.message); + } } - catch (Error e) - { - if (!(e is FileError.NOENT)) - warning ("Failed to load state from %s: %s\n", state_file, e.message); + else { + debug ("State file does not (yet) exist: %s\n", state_file); } } |