From 3e2f9d6fd4e06194670e8fc947ed24754dd005d2 Mon Sep 17 00:00:00 2001 From: Riccardo Zaglia Date: Fri, 13 Sep 2024 02:01:35 +0200 Subject: [PATCH] fix(dashboard): :bug: Fix crash for graphs with no data --- alvr/dashboard/src/dashboard/components/statistics.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/alvr/dashboard/src/dashboard/components/statistics.rs b/alvr/dashboard/src/dashboard/components/statistics.rs index 1937ea643c..7011505939 100644 --- a/alvr/dashboard/src/dashboard/components/statistics.rs +++ b/alvr/dashboard/src/dashboard/components/statistics.rs @@ -84,6 +84,11 @@ impl StatisticsTab { let painter = ui.painter().with_clip_rect(canvas_rect); + if max == min { + // Drawing using a 0 sized rectangle causes a crash + return data_rect; + } + graph_content(&painter, to_screen); ui.painter().text(