From cc95d19ee8ee01f5160ca1b6cdcb998a11559c9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tao=20Bror=20Bojl=C3=A9n?= Date: Fri, 2 Aug 2019 22:49:47 +0300 Subject: [PATCH] fix error in mobile instance view --- CHANGELOG.md | 1 + backend/lib/backend_web/views/graph_view.ex | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 30e0e7c..7c4a692 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - Fixed some instances being duplicated (due to un-normalized data). +- Fixed mobile instance view erroring for uncrawled instances. ### Security diff --git a/backend/lib/backend_web/views/graph_view.ex b/backend/lib/backend_web/views/graph_view.ex index 3c8ca00..96e4976 100644 --- a/backend/lib/backend_web/views/graph_view.ex +++ b/backend/lib/backend_web/views/graph_view.ex @@ -26,12 +26,12 @@ defmodule BackendWeb.GraphView do ranges: %{ # Make sure that these keys match what's in the "node.json" render function. statusesPerDay: [ - Enum.min(statuses_per_day), - Enum.max(statuses_per_day) + Enum.min(statuses_per_day, fn -> nil end), + Enum.max(statuses_per_day, fn -> nil end) ], statusesPerUserPerDay: [ - Enum.min(statuses_per_user_per_day), - Enum.max(statuses_per_user_per_day) + Enum.min(statuses_per_user_per_day, fn -> nil end), + Enum.max(statuses_per_user_per_day, fn -> nil end) ] } }