diff --git a/plugins/builtin/source/content/global_actions.cpp b/plugins/builtin/source/content/global_actions.cpp index 7e8e49631..8af1b0b00 100644 --- a/plugins/builtin/source/content/global_actions.cpp +++ b/plugins/builtin/source/content/global_actions.cpp @@ -1,6 +1,7 @@ #include #include +#include namespace hex::plugin::builtin { @@ -15,8 +16,12 @@ namespace hex::plugin::builtin { } void saveProject() { - if (!ProjectFile::store()) { - View::showErrorPopup("hex.builtin.popup.error.project.save"_lang); + if (ImHexApi::Provider::isValid() && ProjectFile::hasPath()) { + if (!ProjectFile::store()) { + View::showErrorPopup("hex.builtin.popup.error.project.save"_lang); + } else { + log::debug("Project saved"); + } } } diff --git a/plugins/builtin/source/content/main_menu_items.cpp b/plugins/builtin/source/content/main_menu_items.cpp index 67784a158..99d8c3533 100644 --- a/plugins/builtin/source/content/main_menu_items.cpp +++ b/plugins/builtin/source/content/main_menu_items.cpp @@ -77,7 +77,7 @@ namespace hex::plugin::builtin { openProject(); } - if (ImGui::MenuItem("hex.builtin.menu.file.save_project"_lang, "ALT + S", false, providerValid && provider->isWritable() && ProjectFile::hasPath())) { + if (ImGui::MenuItem("hex.builtin.menu.file.save_project"_lang, "ALT + S", false, providerValid && ProjectFile::hasPath())) { saveProject(); }