Not all code paths lead to a profile being created

This commit is contained in:
2023-03-31 11:01:08 +02:00
parent 83a2ceb42d
commit 7ab3a64d56

View File

@@ -20,6 +20,10 @@ namespace Password_Manager
public static void Init() public static void Init()
{ {
bool success = false;
while (!success)
{
if (File.Exists(CONFIGPATH)) if (File.Exists(CONFIGPATH))
{ {
StreamReader sr = new StreamReader(CONFIGPATH); StreamReader sr = new StreamReader(CONFIGPATH);
@@ -47,6 +51,7 @@ namespace Password_Manager
if (path != null && recipient != null) if (path != null && recipient != null)
{ {
Configuration = new Config(path, recipient); Configuration = new Config(path, recipient);
success = true;
} }
else else
{ {
@@ -58,6 +63,7 @@ namespace Password_Manager
CreateDefaultConfig(); CreateDefaultConfig();
} }
} }
}
public static string GetPath() public static string GetPath()
{ {