You are not logged in.
mormot.core.collections, line 902
if fDynArray.Info.ArrayRtti is nil then fDynArray.Info.ArrayRtti.Kind will cause exception
I have random errors from that
constructor TIListParent.CreateRtti(aDynArray: TRttiCustom;
aItemTypeInfo: PRttiInfo; aOptions: TListOptions; aSortAs: TRttiParserType);
begin
fDynArray.InitRtti(aDynArray, fValue, @fCount);
aSortAs := fDynArray.SetParserType(aSortAs, // aSortAs=ptNone->RTTI
loCaseInsensitive in fOptions);
if (fDynArray.Info.ArrayRtti = nil) or
(fDynArray.Info.ArrayRtti.Kind <> aItemTypeInfo^.Kind) then
EIList.RaiseUtf8('%.Create<%> (%) does not match % (%)',
[self, aItemTypeInfo^.RawName, ToText(aItemTypeInfo^.Kind)^,
aDynArray.Info^.RawName, ToText(fDynArray.Info.ArrayRtti.Kind)^]);
Offline
@ab, Delphi 11.3 in a Torm class
but:
if (fDynArray.Info.ArrayRtti = nil) or
(fDynArray.Info.ArrayRtti.Kind <> aItemTypeInfo^.Kind) then
EIList.RaiseUtf8('%.Create<%> (%) does not match % (%)',
[self, aItemTypeInfo^.RawName, ToText(aItemTypeInfo^.Kind)^,
aDynArray.Info^.RawName, ToText(fDynArray.Info.ArrayRtti.Kind)^]);
Offline
Apologies Ab, I did not define anything new
I noticed that this happens since the updates in github after 3/11/25
The exception I get is in EIList.RaiseUtf8 and when debugging the fDynArray.Info.ArrayRtti is nil
Offline
I still don't understand how you defined the IList instance.
I was using NewPlainList instead of NewList, as I notice now.
But still, in the above code if fDynArray.Info.ArrayRtti = nil, then the fDynArray.Info.ArrayRtti.Kind in EIList.RaiseUtf8 will give exception
Offline