Skip to content

Commit

Permalink
fix(gearhandler): add a out of bounds check
Browse files Browse the repository at this point in the history
  • Loading branch information
Torwent committed Aug 3, 2024
1 parent 783b57f commit 8e1174f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions optional/handlers/gearhandler.simba
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,8 @@ end;

function TRSGearHandler.Get(idx: Int32): TRSGear;
begin
if idx = -1 then
Exit;
if idx <= High(Self.Sets) then
Result := Self.Sets[idx];
end;
Expand Down

0 comments on commit 8e1174f

Please sign in to comment.