From 606cd7bdafd6325f732b4b5c721471441353449d Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Wed, 24 Jun 2026 23:49:53 +0200 Subject: [PATCH] Protect against zero frames to show. --- .../src/profiler/TracyView_FrameStatistics.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/profiler/src/profiler/TracyView_FrameStatistics.cpp b/profiler/src/profiler/TracyView_FrameStatistics.cpp index 43fac0bb..fb4dbdab 100644 --- a/profiler/src/profiler/TracyView_FrameStatistics.cpp +++ b/profiler/src/profiler/TracyView_FrameStatistics.cpp @@ -1,5 +1,6 @@ #include "TracyPrint.hpp" #include "TracyView.hpp" +#include "../Fonts.hpp" #include "tracy_pdqsort.h" @@ -112,6 +113,19 @@ void View::DrawFrameStatistics() } } const auto vsz = m_frameSortData.data.size(); + if( vsz == 0 ) + { + TextFocused( "Count:", "0" ); + ImGui::Separator(); + ImGui::PushFont( g_fonts.normal, FontBig ); + ImGui::Dummy( ImVec2( 0, ( ImGui::GetContentRegionAvail().y - ImGui::GetTextLineHeight() * 2 ) * 0.5f ) ); + TextCentered( ICON_FA_COW ); + TextCentered( "No frames to show" ); + ImGui::PopFont(); + ImGui::End(); + return; + } + if( recalc ) { auto& vec = m_frameSortData.data;