ui/label: allow null text

This commit is contained in:
Marcin Kurczewski 2025-04-20 15:41:48 +02:00
parent e7fb4616e8
commit 34a93057c2

View file

@ -65,8 +65,11 @@ void UI_Label(const char *const text)
UI_LabelEx(text, m_DefaultSettings);
}
void UI_LabelEx(const char *const text, const UI_LABEL_SETTINGS settings)
void UI_LabelEx(const char *text, const UI_LABEL_SETTINGS settings)
{
if (text == nullptr) {
text = "(null)"; // quality of life for UI development
}
UI_NODE *const node =
UI_AllocNode(&m_Ops, sizeof(M_DATA) + strlen(text) + 1);
M_DATA *const data = node->data;