fix: Crash when not making a valid selection in provider load interfaces

This commit is contained in:
WerWolv
2023-03-16 16:48:15 +01:00
parent 0312027ca8
commit 7cdba75bef
10 changed files with 20 additions and 11 deletions

View File

@@ -29,11 +29,12 @@ namespace hex::plugin::builtin {
auto provider = hex::ImHexApi::Provider::get();
if (provider != nullptr) {
provider->drawLoadInterface();
bool settingsValid = provider->drawLoadInterface();
ImGui::NewLine();
ImGui::Separator();
ImGui::BeginDisabled(!settingsValid);
if (ImGui::Button("hex.builtin.common.open"_lang)) {
if (provider->open()) {
EventManager::post<EventProviderOpened>(provider);
@@ -44,6 +45,7 @@ namespace hex::plugin::builtin {
TaskManager::doLater([=] { ImHexApi::Provider::remove(provider); });
}
}
ImGui::EndDisabled();
ImGui::SameLine();