1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-10-17 04:46:35 +00:00

improve error report when windowId is invalid.

This commit is contained in:
Mads Buvik Sandvei 2025-02-18 20:59:46 +01:00
parent 593988e82b
commit 9fe420e562

View file

@ -2408,7 +2408,10 @@ namespace MWGui
bool WindowManager::isWindowVisible(std::string_view windowId) const
{
return mLuaIdToWindow.at(windowId)->isVisible();
auto it = mLuaIdToWindow.find(windowId);
if (it == mLuaIdToWindow.end())
throw std::logic_error("Invalid window name: " + std::string(windowId));
return it->second->isVisible();
}
std::vector<std::string_view> WindowManager::getAllWindowIds() const