diff options
author | Haoyu Qiu <timothyqiu32@gmail.com> | 2023-03-08 12:30:37 +0800 |
---|---|---|
committer | Haoyu Qiu <timothyqiu32@gmail.com> | 2023-03-08 15:05:44 +0800 |
commit | 49400e0c1c2c745942133cd63daefad82608958c (patch) | |
tree | 3c152cc3d36f2306e4cbecc8584e3810bfd7d777 /core/extension/extension_api_dump.cpp | |
parent | 013a45706897af989703b944c7cd5f4f58a6c060 (diff) | |
download | redot-engine-49400e0c1c2c745942133cd63daefad82608958c.tar.gz |
Fix crash when dumping extension API in a non-writable directory
Diffstat (limited to 'core/extension/extension_api_dump.cpp')
-rw-r--r-- | core/extension/extension_api_dump.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/core/extension/extension_api_dump.cpp b/core/extension/extension_api_dump.cpp index e26ead6d8c..79b0ebc641 100644 --- a/core/extension/extension_api_dump.cpp +++ b/core/extension/extension_api_dump.cpp @@ -1052,6 +1052,7 @@ void GDExtensionAPIDump::generate_extension_json_file(const String &p_path) { String text = json->stringify(api, "\t", false) + "\n"; Ref<FileAccess> fa = FileAccess::open(p_path, FileAccess::WRITE); + ERR_FAIL_COND_MSG(fa.is_null(), vformat("Cannot open file '%s' for writing.", p_path)); fa->store_string(text); } |