Skip to content

Commit

Permalink
Merge pull request #220 from fernandofcarneiro/master
Browse files Browse the repository at this point in the history
Bug Delphi 10.2: E2362 Cannot access protected symbol TJSONObject.FindValue
  • Loading branch information
viniciussanchez authored Dec 19, 2023
2 parents 835b7e3 + 8557c79 commit 7c8fb82
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/DataSet.Serialize.pas
Original file line number Diff line number Diff line change
Expand Up @@ -363,8 +363,13 @@ procedure TDataSetSerializeHelper.LoadFromJSON(const AJSONObject: TJSONObject; c
{$IF DEFINED(FPC)}
LJSON := AJSONObject.Find(ARootElement);
{$ELSE}
LJSON := AJSONObject.FindValue(ARootElement);
{$ENDIF}
{$IF COMPILERVERSION <= 32}
if not AJSONObject.TryGetValue<TJSONValue>(ARootElement,LJSON) then
LJSON := nil;
{$ELSE}
LJSON := AJSONObject.FindValue(ARootElement);
{$IFEND}
{$ENDIF}
if not Assigned(LJSON) then
raise Exception.Create('Root element not found!');
if LJSON.InheritsFrom(TJSONArray) then
Expand Down

0 comments on commit 7c8fb82

Please sign in to comment.