* Keep old behaviour, but keep issue #40898 solved

This commit is contained in:
Michaël Van Canneyt 2024-08-24 11:02:42 +02:00
parent 97ad8fafd8
commit 58560d333e

View File

@ -1946,11 +1946,16 @@ begin
DupIgnore : Exit;
DupError : Error(SDuplicateString,0)
end;
// Avoid crash in lazarus
if Assigned(aObject) then
InsertItem (Result,S,AObject)
else
InsertItem (Result,S);
InsertItem (Result,S);
if (aObject<>Nil) then
begin
BeginUpdate;
try
Objects[Result]:=AObject;
finally
EndUpdate;
end;
end;
end;
function TStringList.Add(const S: string): Integer;