Skip to content

Commit

Permalink
Merge pull request #445 from FFXIV-CombatReborn/territory-change-redtext
Browse files Browse the repository at this point in the history
Add validation for invalid territory id in ClientState
  • Loading branch information
LTS-FFXIV authored Nov 16, 2024
2 parents 0575aab + 5e94f02 commit c8bae17
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions RotationSolver/RotationSolverPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,13 @@ static void ClientState_TerritoryChanged(ushort id)
{
DataCenter.ResetAllRecords();

// Check if the id is valid before proceeding
if (id == 0)
{
Svc.Log.Warning("Invalid territory id: 0");
return;
}

var territory = Service.GetSheet<TerritoryType>().GetRow(id);

DataCenter.Territory = territory;
Expand Down

0 comments on commit c8bae17

Please sign in to comment.