fix: ImGui assert due to trying to select tab bar button

This commit is contained in:
WerWolv 2025-09-24 20:37:15 +02:00
parent 98e9729267
commit 265360229f
1 changed files with 10 additions and 3 deletions

View File

@ -192,9 +192,16 @@ namespace hex::plugin::builtin {
}
static void selectFirstTabItem() {
auto tabBar = ImGui::GetCurrentTabBar();
if (tabBar != nullptr && tabBar->Tabs.Size > 0) {
tabBar->SelectedTabId = tabBar->Tabs.front().ID;
auto *tabBar = ImGui::GetCurrentTabBar();
if (tabBar != nullptr) {
for (const auto &tab : tabBar->Tabs) {
if (tab.Flags & ImGuiTabItemFlags_Button) {
continue;
}
tabBar->SelectedTabId = tab.ID;
break;
}
}
}