1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-11-21 16:37:12 +01:00

Merge pull request #1204 from crsib/fix_1200

Fixes handling of invalid UpdateScheduledTime
This commit is contained in:
Paul Licameli
2021-07-01 07:33:30 -04:00
committed by GitHub

View File

@@ -136,8 +136,11 @@ void UpdateManager::OnTimer(wxTimerEvent& WXUNUSED(event))
bool UpdateManager::IsTimeForUpdatesChecking()
{
// We use atoll here, so there is no need to handle the exception,
// if prefsUpdateScheduledTime is corrupted.
// atoll will return 0 on failure, which suits us well.
const TimePoint nextUpdatesCheckingTime(std::chrono::milliseconds(
stoll(gPrefs->Read(prefsUpdateScheduledTime, "0").ToStdString())));
atoll(gPrefs->Read(prefsUpdateScheduledTime, "0").c_str())));
// Get current time
const TimePoint currentTime = Clock::now();