aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2024-06-17 11:48:18 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2024-06-18 08:48:10 +0200
commit7e692b9d601d975eadb6c7814b983743ad26c9be (patch)
tree1c6abaffe8f53f114964cd6e72e22323ce73aa67
parent8bc357f3a447fa0bc748d9a3bc1238a8f903c15d (diff)
downloadarctica-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.
-rw-r--r--src/arctica-greeter.vala19
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);
}
}