Skip to content

Commit

Permalink
fix no state crash
Browse files Browse the repository at this point in the history
  • Loading branch information
wiegell committed Nov 29, 2022
1 parent 398a54a commit cc5fcfc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 3 additions & 2 deletions AstroWall/BusinessLayer/ApplicationHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,9 @@ private bool primaryInitAndCheckIfPrefsAreAvail()
// Create status bar icon / menu
MenuHandler.createStatusBar("Astrowall v" + Updates.currentVersion);

// Init state
State = new State(this, currentVersionStringWithCommit);

// Load prefs. If non-present halt further actions until
// preft are confirmed by user
Prefs = Preferences.Preferences.fromSave();
Expand All @@ -117,8 +120,6 @@ private bool primaryInitAndCheckIfPrefsAreAvail()

private async Task secondaryInit(Preferences.Preferences prefsFromPostInstallPrompt)
{
// Init state
State = new State(this, currentVersionStringWithCommit);

// Check for updates.
if (!IncorrectInstallPath)
Expand Down
3 changes: 3 additions & 0 deletions AstroWall/BusinessLayer/Logging.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,11 @@ public static Action<string> GetLogger(string caller, bool isError = false)
private void pruneLogFile()
{
string path = General.getLogPath();
if (File.Exists(path))
{
long size = (new FileInfo(path)).Length;
if (size > 5000000) File.Delete(path);
}
}
}
}
Expand Down

0 comments on commit cc5fcfc

Please sign in to comment.