Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
viniciussanchez committed Nov 14, 2023
1 parent 593596b commit 9a76eeb
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions src/DataSet.Serialize.Import.pas
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ procedure TJSONSerialize.JSONObjectToDataSet(const AJSONObject: TJSONObject; con
LField.Clear;
Continue;
end;
if LJSONValue.AsString='' then
if LJSONValue.Value = EmptyStr then
begin
LField.Clear;
Continue;
Expand All @@ -359,15 +359,9 @@ procedure TJSONSerialize.JSONObjectToDataSet(const AJSONObject: TJSONObject; con
{$ENDIF}
end;
TFieldType.ftInteger, TFieldType.ftSmallint{$IF NOT DEFINED(FPC)}, TFieldType.ftShortint, TFieldType.ftLongWord, TFieldType.ftWord, TFieldType.ftByte{$ENDIF}:
if LJSONValue.AsString='' then
LField.AsVariant := null
else
LField.AsInteger := StrToIntDef(LJSONValue.Value, 0);
LField.AsInteger := StrToIntDef(LJSONValue.Value, 0);
TFieldType.ftLargeint, TFieldType.ftAutoInc:
if LJSONValue.AsString='' then
LField.AsVariant := null
else
LField.AsLargeInt := StrToInt64Def(LJSONValue.Value, 0);
LField.AsLargeInt := StrToInt64Def(LJSONValue.Value, 0);
TFieldType.ftCurrency:
begin
LTryStrToCurr := 0;
Expand Down

0 comments on commit 9a76eeb

Please sign in to comment.