diff --git a/src/client/thing.h b/src/client/thing.h index 03934250..24815d1e 100644 --- a/src/client/thing.h +++ b/src/client/thing.h @@ -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(); diff --git a/src/client/uiitem.cpp b/src/client/uiitem.cpp index eb062013..fdd700a2 100644 --- a/src/client/uiitem.cpp +++ b/src/client/uiitem.cpp @@ -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);