Fixed nullptr crash

This commit is contained in:
2021-08-26 22:11:24 +02:00
parent 3a843d9202
commit bb27dd6d68

View File

@@ -28,7 +28,7 @@ void Label::redraw(std::string_view str, bool forceRedraw)
!forceRedraw)
return;
const auto renderedWidth = tft.drawString(str.data(), m_x, m_y);
const auto renderedWidth = str.empty() ? 0 : tft.drawString(str.data(), m_x, m_y);
const auto renderedHeight = tft.fontHeight();
if (renderedWidth < m_lastWidth)