From 9bb42d52517623ddc03b9a998ceb960eae0e80cc Mon Sep 17 00:00:00 2001 From: Pieter-Jan Briers Date: Fri, 18 Dec 2020 23:55:29 +0100 Subject: [PATCH] Don't fail to start server if invalid jobs exist in preferences. --- Content.Server/GameTicking/GameTicker.JobController.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Content.Server/GameTicking/GameTicker.JobController.cs b/Content.Server/GameTicking/GameTicker.JobController.cs index 32fb69e2e8..1051af0f65 100644 --- a/Content.Server/GameTicking/GameTicker.JobController.cs +++ b/Content.Server/GameTicking/GameTicker.JobController.cs @@ -45,7 +45,11 @@ namespace Content.Server.GameTicking .Where(j => { var (jobId, priority) = j; - var job = _prototypeManager.Index(jobId); + if (!_prototypeManager.TryIndex(jobId, out JobPrototype job)) + { + // Job doesn't exist, probably old data? + return false; + } if (job.IsHead != heads) { return false;