Fix crash when clientid is invalid
This commit is contained in:
parent
2f7a06e93e
commit
3c3ba9ef4c
|
@ -59,6 +59,8 @@ public:
|
||||||
virtual bool isAnimatedText() { return false; }
|
virtual bool isAnimatedText() { return false; }
|
||||||
virtual bool isStaticText() { return false; }
|
virtual bool isStaticText() { return false; }
|
||||||
|
|
||||||
|
virtual bool isValid() { return rawGetThingType() != nullptr; }
|
||||||
|
|
||||||
// type shortcuts
|
// type shortcuts
|
||||||
virtual const ThingTypePtr& getThingType();
|
virtual const ThingTypePtr& getThingType();
|
||||||
virtual ThingType *rawGetThingType();
|
virtual ThingType *rawGetThingType();
|
||||||
|
|
|
@ -44,7 +44,7 @@ void UIItem::drawSelf(Fw::DrawPane drawPane)
|
||||||
|
|
||||||
drawImage(m_rect);
|
drawImage(m_rect);
|
||||||
|
|
||||||
if(m_itemVisible && m_item) {
|
if(m_itemVisible && m_item && m_item->isValid()) {
|
||||||
Rect drawRect = getPaddingRect();
|
Rect drawRect = getPaddingRect();
|
||||||
Point dest = drawRect.bottomRight() + Point(1,1);
|
Point dest = drawRect.bottomRight() + Point(1,1);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue