fix: Adds handling empty spawner files (#2360)

This commit is contained in:
Bohica 2026-03-10 23:04:39 -07:00 committed by GitHub
parent 04d438239d
commit e37ad17d7d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -202,6 +202,13 @@ public static class ImportSpawnersCommand
try
{
var spawners = JsonConfig.Deserialize<List<DynamicJson>>(file.FullName);
if (spawners == null || spawners.Count == 0)
{
from.SendMessage($"GenerateSpawners: Skipping empty spawner file {file.Name}");
logger.Information("{User} is skipping empty spawner file {File}", from, file.FullName);
return;
}
using var queue = PooledRefQueue<Item>.Create();
for (var i = 0; i < spawners.Count; i++)
{