From 69fddcaed69d00953e7b4c6a73071f308c37c885 Mon Sep 17 00:00:00 2001 From: Florian Stinglmayr Date: Thu, 6 Jan 2022 16:15:13 +0100 Subject: [PATCH] fix bug about failed missions --- BGS/Report.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/BGS/Report.cs b/BGS/Report.cs index dcfe7ef..479b7a8 100644 --- a/BGS/Report.cs +++ b/BGS/Report.cs @@ -109,9 +109,9 @@ namespace EliteBGS.BGS { acceptedMissions[accepted.MissionID] = accepted; } else if (e.Is(Events.MissionFailed)) { var failed = e as MissionFailedEntry; - var accepted = acceptedMissions[failed.MissionID]; - if (accepted == null) { - OnLog?.Invoke("Mission failed that wasn't accepted, please adjust time frame."); + MissionAcceptedEntry accepted = null; + if (!acceptedMissions.TryGetValue(failed.MissionID, out accepted)) { + OnLog?.Invoke("Mission failed that wasn't accepted in the given time frame, please adjust start date."); continue; } entry = new MissionFailed(accepted) { Failed = failed, System = current_system };