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
if not aValue.IsObject then
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;
if TDuckTypedList.CanBeWrappedAsList(aValue.AsObject, lWrappedList) then

View File

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