Updated TemplatePro
Some checks failed
TOC Generator / TOC Generator (push) Has been cancelled

This commit is contained in:
Daniele Teti 2024-11-03 22:48:04 +01:00
parent 8503c77b41
commit 2e706f483f
2 changed files with 10 additions and 2 deletions

View File

@ -96,7 +96,11 @@ var
begin begin
if not aValue.IsObject then if not aValue.IsObject then
begin begin
Result := '(Error: Cannot serialize non-object as JSON)'; if aValue.IsType<Int64> then
begin
Exit(aValue.AsInt64);
end;
Exit('(Error: Cannot serialize non-object as JSON)');
end; end;
if TDuckTypedList.CanBeWrappedAsList(aValue.AsObject, lWrappedList) then if TDuckTypedList.CanBeWrappedAsList(aValue.AsObject, lWrappedList) then

View File

@ -459,7 +459,11 @@ function TTProCompiledTemplate.GetDataSetFieldAsTValue(const aDataSet: TDataSet;
var var
lField: TField; lField: TField;
begin begin
lField := aDataSet.FieldByName(FieldName); lField := aDataSet.FindField(FieldName);
if not Assigned(lField) then
begin
Exit(TValue.Empty);
end;
case lField.DataType of case lField.DataType of
ftInteger, ftSmallInt, ftWord: ftInteger, ftSmallInt, ftWord:
Result := lField.AsInteger; Result := lField.AsInteger;