From ae1e9358f188455563429d33268cf8b845726337 Mon Sep 17 00:00:00 2001 From: Khaleel Al-Adhami Date: Fri, 11 Oct 2024 16:22:27 -0700 Subject: [PATCH] only read if it's *not* empty --- reflex/utils/path_ops.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reflex/utils/path_ops.py b/reflex/utils/path_ops.py index 79596716c..f597e0075 100644 --- a/reflex/utils/path_ops.py +++ b/reflex/utils/path_ops.py @@ -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)