1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-07-13 15:17:42 +02: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
commit 33cd75e302
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -117,7 +117,7 @@ void UpdateManager::GetUpdates(bool ignoreNetworkErrors)
wxString()); wxString());
} }
} }
}); });
} }
}); });
} }
@ -136,8 +136,11 @@ void UpdateManager::OnTimer(wxTimerEvent& WXUNUSED(event))
bool UpdateManager::IsTimeForUpdatesChecking() 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( const TimePoint nextUpdatesCheckingTime(std::chrono::milliseconds(
stoll(gPrefs->Read(prefsUpdateScheduledTime, "0").ToStdString()))); atoll(gPrefs->Read(prefsUpdateScheduledTime, "0").c_str())));
// Get current time // Get current time
const TimePoint currentTime = Clock::now(); const TimePoint currentTime = Clock::now();