mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 07:53:26 +00:00
Fix FileAccess::create_temp() default args error
This commit is contained in:
parent
d5ad0556a2
commit
be68ff8cea
1 changed files with 2 additions and 2 deletions
|
@ -81,12 +81,12 @@ Ref<FileAccess> FileAccess::create_for_path(const String &p_path) {
|
|||
Ref<FileAccess> FileAccess::create_temp(int p_mode_flags, const String &p_prefix, const String &p_extension, bool p_keep, Error *r_error) {
|
||||
const String ERROR_COMMON_PREFIX = "Error while creating temporary file";
|
||||
|
||||
if (!p_prefix.is_valid_filename()) {
|
||||
if (!p_prefix.is_empty() && !p_prefix.is_valid_filename()) {
|
||||
*r_error = ERR_FILE_BAD_PATH;
|
||||
ERR_FAIL_V_MSG(Ref<FileAccess>(), vformat(R"(%s: "%s" is not a valid prefix.)", ERROR_COMMON_PREFIX, p_prefix));
|
||||
}
|
||||
|
||||
if (!p_extension.is_valid_filename()) {
|
||||
if (!p_extension.is_empty() && !p_extension.is_valid_filename()) {
|
||||
*r_error = ERR_FILE_BAD_PATH;
|
||||
ERR_FAIL_V_MSG(Ref<FileAccess>(), vformat(R"(%s: "%s" is not a valid extension.)", ERROR_COMMON_PREFIX, p_extension));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue