From 716ac44c29a06e9a0e6267b50e263a65f7aba8ec Mon Sep 17 00:00:00 2001 From: Simon Robertshaw Date: Sun, 29 Jul 2012 13:17:09 +0100 Subject: Fix crash on Component::IsFocused if the component has been detached from the Window diff --git a/src/interface/Component.cpp b/src/interface/Component.cpp index 3c52ed9..e4c6811 100644 --- a/src/interface/Component.cpp +++ b/src/interface/Component.cpp @@ -113,7 +113,9 @@ void Component::TextPosition(std::string displayText) bool Component::IsFocused() const { - return parentstate_->IsFocused(this); + if(parentstate_) + return parentstate_->IsFocused(this); + return false; } void Component::SetParentWindow(Window* window) -- cgit v0.9.2-21-gd62e