Skip to content

Commit bdfaf96

Browse files
committed
fix EvilBeaver#1580.9: исключение "Неправильное смещение внутри коллекции"
1 parent dc8eaae commit bdfaf96

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/OneScript.Core/Exceptions/RuntimeException.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,14 @@ public static RuntimeException InvalidEncoding(string encoding)
175175
return new RuntimeException(
176176
$"Неправильное имя кодировки '{encoding}'",
177177
$"Invalid encoding name '{encoding}'");
178+
}
179+
180+
public static RuntimeException IncorrectOffset()
181+
{
182+
return new RuntimeException(
183+
$"Неправильное смещение внутри коллекции",
184+
$"Incorrect offset within collection");
178185
}
179-
180186
#endregion
181187
}
182188
}

src/OneScript.StandardLibrary/Collections/ValueTable/ValueTable.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,7 @@ public void Move(BslValue row, int offset)
528528
int index_dest = index_source + offset;
529529

530530
if (index_dest < 0 || index_dest >= _rows.Count)
531-
throw RuntimeException.InvalidNthArgumentValue(2);
531+
throw RuntimeException.IncorrectOffset();
532532

533533
ValueTableRow tmp = _rows[index_source];
534534

0 commit comments

Comments
 (0)