mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-19 04:19:09 +02:00
ValEdit: Fix crash in InsertRow if Strings.Count = 0.
Issue #0025144. git-svn-id: trunk@43109 -
This commit is contained in:
parent
9b3994023a
commit
00ac786d09
@ -819,7 +819,12 @@ begin
|
|||||||
Strings.BeginUpdate;
|
Strings.BeginUpdate;
|
||||||
try
|
try
|
||||||
if Append then
|
if Append then
|
||||||
NewInd := Row - FixedRows + 1 //append after current row
|
begin
|
||||||
|
if (Strings.Count = 0) then //empty grid
|
||||||
|
NewInd := 0
|
||||||
|
else
|
||||||
|
NewInd := Row - FixedRows + 1 //append after current row
|
||||||
|
end
|
||||||
else
|
else
|
||||||
NewInd := Row - FixedRows; //insert it at current row
|
NewInd := Row - FixedRows; //insert it at current row
|
||||||
Strings.InsertItem(NewInd, Line, Nil);
|
Strings.InsertItem(NewInd, Line, Nil);
|
||||||
|
Loading…
Reference in New Issue
Block a user