From 6e047a028762d6baeada94683c0e5b5238d5fe1e Mon Sep 17 00:00:00 2001 From: Ashwin Balasubramaniyan Date: Wed, 19 Nov 2025 13:19:29 -0500 Subject: [PATCH] Fix bug where optional argument is not validated before use --- core/io/json.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/io/json.cpp b/core/io/json.cpp index 5d58e49f198..857695e2b95 100644 --- a/core/io/json.cpp +++ b/core/io/json.cpp @@ -1554,7 +1554,9 @@ Ref ResourceFormatLoaderJSON::load(const String &p_path, const String } if (!FileAccess::exists(p_path)) { - *r_error = ERR_FILE_NOT_FOUND; + if (r_error) { + *r_error = ERR_FILE_NOT_FOUND; + } return Ref(); }