diff options
author | rtk0c <[email protected]> | 2022-05-22 21:16:26 -0700 |
---|---|---|
committer | rtk0c <[email protected]> | 2022-05-22 21:16:26 -0700 |
commit | 195e30b1e39fa4dc535172ba248f0c18733dcb3c (patch) | |
tree | a87c6cc49d498d3e9c921e4ad38c0101011ad1d5 /core/src/UI | |
parent | ee450783622008698647010540d9b9a9d55cb323 (diff) |
Get rid of the annoying wrong "dereferencing null pointer" warnings
Diffstat (limited to 'core/src/UI')
-rw-r--r-- | core/src/UI/UI_Utils.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
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; } |