From c4ab2f417aec0504910c8df334c26f76dd5329e3 Mon Sep 17 00:00:00 2001 From: scrawl Date: Tue, 7 Jan 2014 18:11:19 +0100 Subject: [PATCH] Fix exception closing container window --- apps/openmw/mwgui/container.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/apps/openmw/mwgui/container.cpp b/apps/openmw/mwgui/container.cpp index 31cfd8bc94..b4de0aa625 100644 --- a/apps/openmw/mwgui/container.cpp +++ b/apps/openmw/mwgui/container.cpp @@ -242,9 +242,11 @@ namespace MWGui { WindowBase::close(); - // Make sure we were actually closed, rather than just temporarily hidden (e.g. console or main menu opened) - if (!MWBase::Environment::get().getWindowManager()->containsMode(GM_Container) - && !mPickpocketDetected // If it was already detected while taking an item, no need to check now + if (dynamic_cast(mModel) + // Make sure we were actually closed, rather than just temporarily hidden (e.g. console or main menu opened) + && !MWBase::Environment::get().getWindowManager()->containsMode(GM_Container) + // If it was already detected while taking an item, no need to check now + && !mPickpocketDetected ) { MWMechanics::Pickpocket pickpocket(MWBase::Environment::get().getWorld()->getPlayer().getPlayer(),