[Crash] Fix rarer world crash issue where scheduler database was not available (#2789)

This commit is contained in:
Chris Miles 2023-01-24 12:38:26 -06:00 committed by GitHub
parent 4d355afe9d
commit 037be84f38
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -143,6 +143,10 @@ bool ServerEventScheduler::ValidateDatabaseConnection()
// this helps inform decisions to tell all zones to reload their events
bool ServerEventScheduler::CheckIfEventsChanged()
{
if (!m_database) {
return false;
}
auto events = ServerScheduledEventsRepository::GetWhere(*m_database, "deleted_at is null");
// first check if the size changed, if it did this is the easiest step