Skip to content

Commit b434e5a

Browse files
committed
Fix the exception that gets thrown on an invalid index
1 parent 517defa commit b434e5a

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

Scarlet.IO.ContainerFormats/GPDA.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,7 @@ public override int GetElementCount()
7575

7676
protected override ContainerElement GetElement(Stream containerStream, int elementIndex)
7777
{
78-
if ((elementIndex < 0) || (elementIndex >= NumFiles))
79-
throw new ArgumentException("Invalid element index.");
78+
if (elementIndex < 0 || elementIndex >= NumFiles) throw new IndexOutOfRangeException("Invalid file index specified");
8079

8180
return Files[elementIndex];
8281
}

0 commit comments

Comments
 (0)