From a0f5907cb61dbddc6fa28d35a4acbb3ba3d98a34 Mon Sep 17 00:00:00 2001 From: Geoffrey McRae Date: Sat, 11 Nov 2023 13:18:01 +1100 Subject: [PATCH] [client] overlay: prevent possible divide by zero --- client/src/overlay/graphs.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/client/src/overlay/graphs.c b/client/src/overlay/graphs.c index d56df4b5..417e866b 100644 --- a/client/src/overlay/graphs.c +++ b/client/src/overlay/graphs.c @@ -143,6 +143,12 @@ static int graphs_render(void * udata, bool interactive, ++graphCount; } + if (!graphCount) + { + ll_unlock(gs.graphs); + return 0; + } + ImVec2 pos = {0.0f, 0.0f}; igSetNextWindowBgAlpha(0.4f); igSetNextWindowPos(pos, ImGuiCond_FirstUseEver, pos);