Skip to content

Commit

Permalink
only read if it's *not* empty (#4165)
Browse files Browse the repository at this point in the history
  • Loading branch information
adhami3310 authored and simon committed Oct 23, 2024
1 parent 2a68f83 commit de01347
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion reflex/utils/path_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ def update_json_file(file_path: str | Path, update_dict: dict[str, int | str]):

# Read the existing json object from the file.
json_object = {}
if fp.stat().st_size == 0:
if fp.stat().st_size:
with open(fp) as f:
json_object = json.load(f)

Expand Down

0 comments on commit de01347

Please sign in to comment.