* try to avoid incompatibility with lazarus (and possibly others)

This commit is contained in:
Michaël Van Canneyt 2024-08-22 14:45:28 +02:00
parent 4112318e2f
commit edde858cfa

View File

@ -1946,7 +1946,11 @@ begin
DupIgnore : Exit; DupIgnore : Exit;
DupError : Error(SDuplicateString,0) DupError : Error(SDuplicateString,0)
end; end;
InsertItem (Result,S,AObject); // Avoid crash in lazarus
if Assigned(aObject) then
InsertItem (Result,S,AObject)
else
InsertItem (Result,S);
end; end;
function TStringList.Add(const S: string): Integer; function TStringList.Add(const S: string): Integer;