1
0
mirror of synced 2025-01-29 19:17:28 +01:00

fix: No provider being selected in some cases when closing a provider

This commit is contained in:
WerWolv 2023-10-01 20:18:26 +02:00
parent 9dbae2051b
commit bcab657a06

View File

@ -312,8 +312,12 @@ namespace hex {
if (it == s_providers.end())
return;
if (!s_providers.empty() && it - s_providers.begin() == s_currentProvider)
setCurrentProvider(0);
if (!s_providers.empty()) {
if (it == s_providers.begin())
setCurrentProvider(0);
else if (std::distance(s_providers.begin(), it) < 0)
setCurrentProvider(s_currentProvider - 1);
}
s_providers.erase(it);
if (s_providers.empty())