If the file being parsed has no bots, skip over it instead of throwing an exception

This commit is contained in:
Chomp 2021-08-12 17:19:54 +01:00
parent 6df06c5063
commit 5f7289f88f

View File

@ -43,6 +43,13 @@ namespace Generator
try try
{ {
var bots = ParseJson(json, file); 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()}"); Console.WriteLine($"parsing: {bots.Count} bots in file {splitFile.Last()}");
foreach (var bot in bots) foreach (var bot in bots)
{ {