Do not consider missing passwordstorerc file as error.
authorAndrej Kacian <ticho@claws-mail.org>
Sat, 20 Jan 2018 13:36:38 +0000 (14:36 +0100)
committerAndrej Kacian <ticho@claws-mail.org>
Sat, 20 Jan 2018 13:37:43 +0000 (14:37 +0100)
Just continue with empty password store.

src/passwordstore.c

index 2f1d6c1..5709f15 100644 (file)
@@ -419,11 +419,17 @@ int passwd_store_read_config(void)
 
        /* TODO: passwd_store_clear(); */
 
-       debug_print("Reading password store from file...\n");
-
        rcpath = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S,
                        PASSWORD_STORE_RC, NULL);
 
+       debug_print("Reading password store from file '%s'\n", rcpath);
+
+       if (!g_file_test(rcpath, G_FILE_TEST_EXISTS)) {
+               debug_print("File does not exist, looks like a new configuration.\n");
+               g_free(rcpath);
+               return 0;
+       }
+
        if (!g_file_get_contents(rcpath, &contents, NULL, &error)) {
                g_warning("couldn't read password store from file: %s", error->message);
                g_error_free(error);