Fix crash when calculating visit duration with 0 sessions

This commit is contained in:
Uku Taht 2021-04-05 15:24:42 +03:00
parent 61676db4a7
commit 968d280304

View File

@ -25,7 +25,7 @@ defmodule Plausible.Stats.Fragments do
defmacro visit_duration() do defmacro visit_duration() do
quote do quote do
fragment("toUInt32(round(avg(duration * sign)))") fragment("toUInt32(ifNotFinite(round(avg(duration * sign)), 0))")
end end
end end