1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-07-25 17:08:07 +02:00

Fixes handling of invalid UpdateScheduledTime

This commit is contained in:
Dmitry Vedenko 2021-07-01 13:35:35 +03:00
parent 84d5e63dbc
commit 2c7f5da8c6

View File

@ -117,7 +117,7 @@ void UpdateManager::GetUpdates(bool ignoreNetworkErrors)
wxString());
}
}
});
});
}
});
}
@ -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();