From 05819824b2db99da1ffed691a0b6ea76200b64cb Mon Sep 17 00:00:00 2001 From: Lynnesbian Date: Sun, 27 Sep 2020 15:57:28 +1000 Subject: [PATCH] handle files with no statements --- Program.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Program.cs b/Program.cs index a947d81..3d32c2e 100644 --- a/Program.cs +++ b/Program.cs @@ -135,6 +135,11 @@ namespace BunyMuny { Console.WriteLine(statement); } + if (statements.Count == 0) { + Console.WriteLine("No statements found."); + return 2; + } + Console.WriteLine("Summary:"); Console.WriteLine("=================="); var summaries = statements.GroupBy(s => s.Category). // group statements by category