From 13919391515c6eea6ae27c23f88bee179bd54b3f Mon Sep 17 00:00:00 2001 From: Dario Manesku Date: Wed, 6 Aug 2014 08:23:54 +0100 Subject: [PATCH] Fixed drawText() to handle NULL or empty string. --- examples/common/imgui/imgui.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/examples/common/imgui/imgui.cpp b/examples/common/imgui/imgui.cpp index ac7cf986..5577a708 100644 --- a/examples/common/imgui/imgui.cpp +++ b/examples/common/imgui/imgui.cpp @@ -1635,6 +1635,12 @@ struct Imgui void drawText(float _x, float _y, const char* _text, ImguiTextAlign::Enum _align, uint32_t _abgr) { + if (NULL == _text + || '\0' == _text[0]) + { + return; + } + #if USE_NANOVG_FONT static uint32_t textAlign[ImguiTextAlign::Count] = {