Skip to content

Error loading the Json file if it does not exist. #28

Description

@dalfy15

If we upload a non-existing Json file, an error appears.
Maybe add a file existence check and if it doesn't exist, then create an empty object?
LoadFromFile:
if SysUtils.FileExists( FileName ) then
begin
F := TFileStream.Create( FileName, fmOpenRead );
...
end
else
FJson.AsObject;

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions