From bab751591fbc5822543012b14e02b4dd4ba4b74c Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Mon, 17 May 2021 18:18:40 +0200 Subject: [PATCH] Make sure we have a valid timezone Signed-off-by: Thomas Citharel --- lib/service/notifications/scheduler.ex | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/service/notifications/scheduler.ex b/lib/service/notifications/scheduler.ex index 773bb4689..3a37e7e30 100644 --- a/lib/service/notifications/scheduler.ex +++ b/lib/service/notifications/scheduler.ex @@ -291,6 +291,8 @@ defmodule Mobilizon.Service.Notifications.Scheduler do end defp date_to_datetime(%Date{} = day, time, timezone) do + # Just in case + timezone = timezone || "Etc/UTC" {:ok, datetime} = NaiveDateTime.new(day, time) {:ok, datetime} = DateTime.from_naive(datetime, timezone) datetime