diff --git a/docs/CHANGELOG.txt b/docs/CHANGELOG.txt index 836c57a5f..1ec9ff645 100644 --- a/docs/CHANGELOG.txt +++ b/docs/CHANGELOG.txt @@ -71,6 +71,7 @@ Other Changes: unmoved. We revert back to move to the end of line in this situation. - DrawList: fixed CloneOutput() unnecessarily taking a copy of the ImDrawListSharedData pointer, which could to issue when deleting the cloned list. (#8894, #1860) +- DrawList: made AddCallback() assert when passing a null callback. - Debug Tools: ID Stack Tool: fixed using fixed-size buffers preventing long identifiers from being displayed in the tool. (#8905, #4631) - Debug Tools: ID Stack Tool: when ### is used, uncontributing prefix before the ### diff --git a/imgui_draw.cpp b/imgui_draw.cpp index 9f2867859..9b01047f0 100644 --- a/imgui_draw.cpp +++ b/imgui_draw.cpp @@ -518,6 +518,7 @@ void ImDrawList::AddCallback(ImDrawCallback callback, void* userdata, size_t use { IM_ASSERT_PARANOID(CmdBuffer.Size > 0); ImDrawCmd* curr_cmd = &CmdBuffer.Data[CmdBuffer.Size - 1]; + IM_ASSERT(callback != NULL); IM_ASSERT(curr_cmd->UserCallback == NULL); if (curr_cmd->ElemCount != 0) {