summaryrefslogtreecommitdiff
path: root/src/interface/Component.cpp
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2012-07-29 12:17:09 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2012-07-29 12:17:09 (GMT)
commit716ac44c29a06e9a0e6267b50e263a65f7aba8ec (patch)
tree3824858d9884a36f23bb63ab4a36b25929bb1e51 /src/interface/Component.cpp
parent90ad1fd8564f8a305932b1488159c1f784c04ae8 (diff)
downloadpowder-716ac44c29a06e9a0e6267b50e263a65f7aba8ec.zip
powder-716ac44c29a06e9a0e6267b50e263a65f7aba8ec.tar.gz
Fix crash on Component::IsFocused if the component has been detached from the Window
Diffstat (limited to 'src/interface/Component.cpp')
-rw-r--r--src/interface/Component.cpp4
1 files changed, 3 insertions, 1 deletions
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)