Fix crash when clientid is invalid

This commit is contained in:
Henrique Santiago 2013-02-07 03:13:08 -02:00
parent 2f7a06e93e
commit 3c3ba9ef4c
2 changed files with 3 additions and 1 deletions

View File

@ -59,6 +59,8 @@ public:
virtual bool isAnimatedText() { return false; }
virtual bool isStaticText() { return false; }
virtual bool isValid() { return rawGetThingType() != nullptr; }
// type shortcuts
virtual const ThingTypePtr& getThingType();
virtual ThingType *rawGetThingType();

View File

@ -44,7 +44,7 @@ void UIItem::drawSelf(Fw::DrawPane drawPane)
drawImage(m_rect);
if(m_itemVisible && m_item) {
if(m_itemVisible && m_item && m_item->isValid()) {
Rect drawRect = getPaddingRect();
Point dest = drawRect.bottomRight() + Point(1,1);