Skip to content

Commit

Permalink
Comment not required variable, which can cause an IndexOutOfBoundsExc…
Browse files Browse the repository at this point in the history
…eption
  • Loading branch information
TomMuehlegger committed Nov 26, 2024
1 parent ca881a2 commit 94cf6df
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion LibNoDaveConnectionLibrary/PLCs/S7_xxx/MC7/JumpMarks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ public static List<FunctionBlockRow> AddJumpmarks(List<FunctionBlockRow> myBlk,

if (JumpMarks != null && JumpMarks.Length >= 5)
{
int anzJ = BitConverter.ToInt16(JumpMarks, NetworkCount * 2); //Todo: find out why it does not always contain the right amount of JumpNames
// Comment this out, as the variable anzJ is not used at all and it sometimes throws and IndexOutOfBounds Exception
// Eg. there are 68 jump marks, but the Network count is 40 => access from index 80 --> IOB Exception
// int anzJ = BitConverter.ToInt16(JumpMarks, NetworkCount * 2); //Todo: find out why it does not always contain the right amount of JumpNames

for (int n = NetworkCount * 2 + 4; n < JumpMarks.Length; n += 5)
{
Expand Down

0 comments on commit 94cf6df

Please sign in to comment.