From 5f7289f88f198c14efd623c90a7c9fcef058c0c1 Mon Sep 17 00:00:00 2001 From: Chomp Date: Thu, 12 Aug 2021 17:19:54 +0100 Subject: [PATCH] If the file being parsed has no bots, skip over it instead of throwing an exception --- Generator/BotParser.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Generator/BotParser.cs b/Generator/BotParser.cs index 858e67b..f4befe9 100644 --- a/Generator/BotParser.cs +++ b/Generator/BotParser.cs @@ -43,6 +43,13 @@ namespace Generator try { var bots = ParseJson(json, file); + + if (bots == null || bots.Count == 0) + { + Console.WriteLine($"no bots found, skipping file: {splitFile.Last()}"); + continue; + } + Console.WriteLine($"parsing: {bots.Count} bots in file {splitFile.Last()}"); foreach (var bot in bots) {