From 326e51750bae9bd6df504b2c73644f389a4cf90a Mon Sep 17 00:00:00 2001 From: yds Date: Mon, 15 Jul 2024 17:35:47 -0300 Subject: [PATCH] Fix error when exporting files without import parameters --- editor/export/editor_export_platform.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/editor/export/editor_export_platform.cpp b/editor/export/editor_export_platform.cpp index c0646dc572c..0768ae128bc 100644 --- a/editor/export/editor_export_platform.cpp +++ b/editor/export/editor_export_platform.cpp @@ -1229,8 +1229,12 @@ Error EditorExportPlatform::export_project_files(const Ref & config->set_value("remap", "path", export_path); // Erase useless sections. - config->erase_section("deps"); - config->erase_section("params"); + if (config->has_section("deps")) { + config->erase_section("deps"); + } + if (config->has_section("params")) { + config->erase_section("params"); + } String import_text = config->encode_to_text(); CharString cs = import_text.utf8(); @@ -1294,8 +1298,12 @@ Error EditorExportPlatform::export_project_files(const Ref & } // Erase useless sections. - config->erase_section("deps"); - config->erase_section("params"); + if (config->has_section("deps")) { + config->erase_section("deps"); + } + if (config->has_section("params")) { + config->erase_section("params"); + } String import_text = config->encode_to_text(); CharString cs = import_text.utf8();