summaryrefslogtreecommitdiffstats
path: root/platform/javascript/export/export.cpp
diff options
context:
space:
mode:
authorRicardo Lüders <rluders@redhat.com>2019-03-05 08:52:45 +0100
committerRicardo Lüders <rluders@redhat.com>2019-03-05 21:32:52 +0100
commit3fdbdd838074b3f6b78e6f6c2fae1f3a407c2446 (patch)
treef6c98fbe599f9605ee4afb63bc4b0a24d8cb3288 /platform/javascript/export/export.cpp
parent9dd9737cb43dc871661945adcc1784756f28a118 (diff)
downloadredot-engine-3fdbdd838074b3f6b78e6f6c2fae1f3a407c2446.tar.gz
Fixes misleading error message when trying to export
This patch fixes the misleading error message when users try to "export all" into an invalid destination path. Closes #26539
Diffstat (limited to 'platform/javascript/export/export.cpp')
-rw-r--r--platform/javascript/export/export.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/platform/javascript/export/export.cpp b/platform/javascript/export/export.cpp
index 5704433650..d9f08f2a1b 100644
--- a/platform/javascript/export/export.cpp
+++ b/platform/javascript/export/export.cpp
@@ -211,6 +211,10 @@ Error EditorExportPlatformJavaScript::export_project(const Ref<EditorExportPrese
template_path = find_export_template(EXPORT_TEMPLATE_WEBASSEMBLY_RELEASE);
}
+ if (!FileAccess::exists(p_path.get_base_dir())) {
+ return ERR_FILE_BAD_PATH;
+ }
+
if (template_path != String() && !FileAccess::exists(template_path)) {
EditorNode::get_singleton()->show_warning(TTR("Template file not found:") + "\n" + template_path);
return ERR_FILE_NOT_FOUND;