From c8e985cb3980806e1d5e54057f92e95b077d2f0a Mon Sep 17 00:00:00 2001 From: Florian Stinglmayr Date: Thu, 30 Sep 2021 13:32:31 +0200 Subject: [PATCH] fix finding an entry for collating --- BGS/Report.cs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/BGS/Report.cs b/BGS/Report.cs index d9b30ca..b9a0cd0 100644 --- a/BGS/Report.cs +++ b/BGS/Report.cs @@ -145,12 +145,14 @@ namespace NonaBGS.BGS { LogEntry existing = null; - try { - existing = objective.LogEntries.Find(x => x.CompareTo(entry) == 0); - } catch (NotImplementedException) { - // Equivalent to not having found anything - existing = null; - } + existing = objective.LogEntries.Find(x => { + try { + return x.CompareTo(entry) == 0; + } catch (NotImplementedException) { + return false; + } + }); + if (collate && existing != null) { existing.Entries.Add(e); } else if (!collate || existing == null) {