From 746ba47f1e08ec84f13f82b8ff904286ecb65cc8 Mon Sep 17 00:00:00 2001 From: Anna Date: Sun, 28 Jul 2024 16:45:10 -0400 Subject: [PATCH] fix: only return null if there are no lines --- Evaluator.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Evaluator.cs b/Evaluator.cs index 8d851f6..1ac0aad 100644 --- a/Evaluator.cs +++ b/Evaluator.cs @@ -25,11 +25,13 @@ public class Evaluator { } } - if (!this.Lines.TryGetValue(evaluation, out var currentLines)) { - return null; + if (this.Lines.TryGetValue(evaluation, out var currentLines)) { + lines.AddRange(currentLines); } - lines.AddRange(currentLines); + if (lines.Count == 0) { + return null; + } var template = Random.Shared.GetItems(lines.ToArray(), 1)[0]; var line = new SeStringBuilder();