Fixed nullptr crash
This commit is contained in:
1 parent
3a843d9202
commit
bb27dd6d68
1 file changed
+1
-1
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user