diff --git a/gfx/element.lua b/gfx/element.lua index c1b569d..6f74963 100644 --- a/gfx/element.lua +++ b/gfx/element.lua @@ -126,9 +126,12 @@ function Element:_setWindow(window) end function Element:setVisible(visible) - self:setDirty() + local win = self:_getWindow() self.visible = visible - self:_getWindow().setVisible(visible) + if win ~= nil then + self:setDirty() + self:_getWindow().setVisible(visible) + end end function Element:_isDirty()