Skip to content

Commit 94cf6df

Browse files
committed
Comment not required variable, which can cause an IndexOutOfBoundsException
1 parent ca881a2 commit 94cf6df

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

LibNoDaveConnectionLibrary/PLCs/S7_xxx/MC7/JumpMarks.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ public static List<FunctionBlockRow> AddJumpmarks(List<FunctionBlockRow> myBlk,
5252

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

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

0 commit comments

Comments
 (0)