Skip to content

Commit

Permalink
Add null check for monster in ArchMageMatsArmy and log warning if not…
Browse files Browse the repository at this point in the history
… found
  • Loading branch information
PUNK3DAF committed Nov 4, 2024
1 parent 1c7711a commit 4e872dc
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Army/Various/ArmyArchMageBossItems.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,13 @@ public void ArmyKillMonster(string map, string cell, int MonID, string item, int
Core.Join(map);
Army.waitForPartyCell(cell, playerCount: Army.Players().Count());

Monster mon = Bot.Monsters.MapMonsters.FirstOrDefault(x => x != null && x.ID == MonID);
Monster? mon = Bot.Monsters.MapMonsters.FirstOrDefault(x => x != null && x.ID == MonID);

if (mon == null)
{
Core.Logger($"Monster {MonID} not found.");
return;
}

if (!isTemp)
Core.AddDrop(item);
Expand Down

0 comments on commit 4e872dc

Please sign in to comment.