mirror of
https://github.com/tuxdotrs/highminded.git
synced 2025-08-22 23:51:03 +05:30
fix: program crashes if settings file doesn't exist
This commit is contained in:
@@ -14,7 +14,7 @@ public class InMemoryDb
|
||||
private InMemoryDb()
|
||||
{
|
||||
SettingsManager = new SettingsManager<AppSettings>();
|
||||
if (SettingsManager.Settings.ApiKey != string.Empty)
|
||||
if (SettingsManager.Settings.ApiKey != null)
|
||||
{
|
||||
InitOpenAIClient();
|
||||
}
|
||||
|
@@ -20,7 +20,7 @@ public class SettingsManager<T> where T : class, new()
|
||||
public SettingsManager(string appName = "highminded")
|
||||
{
|
||||
_settingsPath = Path.Combine(Environment.CurrentDirectory, "settings.json");
|
||||
Settings = Load();
|
||||
Settings = Load();
|
||||
}
|
||||
|
||||
private T Load()
|
||||
|
Reference in New Issue
Block a user