From 716ac44c29a06e9a0e6267b50e263a65f7aba8ec Mon Sep 17 00:00:00 2001 From: Simon Robertshaw Date: Sun, 29 Jul 2012 13:17:09 +0100 Subject: [PATCH] Fix crash on Component::IsFocused if the component has been detached from the Window --- src/interface/Component.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/interface/Component.cpp b/src/interface/Component.cpp index 3c52ed9dc..e4c681157 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)