Skip to content

Commit

Permalink
Print error when globalize_path() fails
Browse files Browse the repository at this point in the history
  • Loading branch information
timothyqiu committed Oct 23, 2024
1 parent 533c616 commit 24a7e02
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions core/config/project_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -258,18 +258,14 @@ void ProjectSettings::add_hidden_prefix(const String &p_prefix) {

String ProjectSettings::globalize_path(const String &p_path) const {
if (p_path.begins_with("res://")) {
if (!resource_path.is_empty()) {
return p_path.replace("res:/", resource_path);
}
return p_path.replace("res://", "");
} else if (p_path.begins_with("user://")) {
ERR_FAIL_COND_V_MSG(resource_path.is_empty(), p_path.replace("res://", ""), "Can't globalize `res://` paths in exported project.");
return p_path.replace("res:/", resource_path);
}
if (p_path.begins_with("user://")) {
String data_dir = OS::get_singleton()->get_user_data_dir();
if (!data_dir.is_empty()) {
return p_path.replace("user:/", data_dir);
}
return p_path.replace("user://", "");
ERR_FAIL_COND_V(data_dir.is_empty(), p_path.replace("user://", ""));
return p_path.replace("user:/", data_dir);
}

return p_path;
}

Expand Down

0 comments on commit 24a7e02

Please sign in to comment.