Fix crash when querying bounce rate with 0 sessions

pull/910/head
Uku Taht 6 years ago
parent f0725e2578
commit 61676db4a7

@ -19,7 +19,7 @@ defmodule Plausible.Stats.Fragments do
defmacro bounce_rate() do
quote do
fragment("toUInt32(round(sum(is_bounce * sign) / sum(sign) * 100))")
fragment("toUInt32(ifNotFinite(round(sum(is_bounce * sign) / sum(sign) * 100), 0))")
end
end

Loading…
Cancel
Save