diff --git a/lib/philomena_web/templates/stat/index.html.slime b/lib/philomena_web/templates/stat/index.html.slime index 786bc55b..944c4063 100644 --- a/lib/philomena_web/templates/stat/index.html.slime +++ b/lib/philomena_web/templates/stat/index.html.slime @@ -33,7 +33,7 @@ elixir: p ' There are, on average, span.stat> - = number_with_delimiter(trunc(img_bucket["non_deleted"]["avg_comments"]["value"])) + = number_with_delimiter(trunc(img_bucket["non_deleted"]["avg_comments"]["value"] || 0)) ' comments on each image on the site. h3 Votes diff --git a/lib/philomena_web/views/stat_view.ex b/lib/philomena_web/views/stat_view.ex index c77297a0..9cdf4bc1 100644 --- a/lib/philomena_web/views/stat_view.ex +++ b/lib/philomena_web/views/stat_view.ex @@ -8,7 +8,7 @@ defmodule PhilomenaWeb.StatView do { %{"doc_count" => min_docs}, %{"doc_count" => max_docs} - } = Enum.min_max_by(data, & &1["doc_count"], fn -> %{"doc_count" => 0} end) + } = Enum.min_max_by(data, & &1["doc_count"], fn -> {%{"doc_count" => 0}, %{"doc_count" => 0}} end) graph_width = 950 graph_height = 475