diff --git a/src/main.v b/src/main.v index b6e34b7..4eea080 100644 --- a/src/main.v +++ b/src/main.v @@ -133,8 +133,10 @@ fn get_ppu() !f64 { mut people := sql db { select from Person where status == 3 }! + if people.len == 0 { + return 0 + } people.sort(a.order_time < b.order_time) - time_range := people.last().order_time - people.first().order_time return people.len / time_range.hours() }