diff --git a/imgui.cpp b/imgui.cpp index d50a7ead2..913f9a99b 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -2380,6 +2380,11 @@ ImGuiID ImHashData(const void* data_p, size_t data_size, ImGuiID seed) // FIXME-OPT: Replace with e.g. FNV1a hash? CRC32 pretty much randomly access 1KB. Need to do proper measurements. ImGuiID ImHashStr(const char* data_p, size_t data_size, ImGuiID seed) { + if (data_p == nullptr) + { + return seed; + } + seed = ~seed; ImU32 crc = seed; const unsigned char* data = (const unsigned char*)data_p;