From 195e30b1e39fa4dc535172ba248f0c18733dcb3c Mon Sep 17 00:00:00 2001 From: rtk0c Date: Sun, 22 May 2022 21:16:26 -0700 Subject: Get rid of the annoying wrong "dereferencing null pointer" warnings --- core/src/UI/UI_Utils.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'core/src/UI') diff --git a/core/src/UI/UI_Utils.cpp b/core/src/UI/UI_Utils.cpp index e3ac097..a2bf692 100644 --- a/core/src/UI/UI_Utils.cpp +++ b/core/src/UI/UI_Utils.cpp @@ -41,6 +41,9 @@ bool ImGui::Button(const char* label, const ImVec2& sizeArg, bool disabled) bool res = ImGui::Button(label, sizeArg); if (disabled) PopDisabled(); + // Help clang-tidy's static analyzer: if the button is disabled, res should always be false + assert(!disabled || (disabled && !res)); + return res; } -- cgit v1.2.3-70-g09d2