瀏覽代碼

* Fix wrong index check for insert, border is different

git-svn-id: trunk@34834 -
michael 8 年之前
父節點
當前提交
32ec90dccf
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      rtl/objpas/classes/stringl.inc

+ 2 - 1
rtl/objpas/classes/stringl.inc

@@ -1629,7 +1629,8 @@ begin
     Error (SSortedListError,0)
   else
     begin
-    CheckIndex(Index);
+    If (Index<0) or (Index>FCount) then
+      Error(SListIndexError,Index); // Cannot use CheckIndex, because there >= FCount...
     InsertItem (Index,S);
     end;
 end;