Skip to content

Commit

Permalink
fix(dashboard): 🐛 Fix crash for graphs with no data
Browse files Browse the repository at this point in the history
  • Loading branch information
zmerp committed Sep 13, 2024
1 parent 428cc97 commit 3e2f9d6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions alvr/dashboard/src/dashboard/components/statistics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 3e2f9d6

Please sign in to comment.