From 4bfb7d8dd3ff81f72ce511acab62582bada723b3 Mon Sep 17 00:00:00 2001 From: "byte[]" Date: Thu, 13 Aug 2020 17:55:36 -0400 Subject: [PATCH] always assign advert, even if nil --- lib/philomena_web/plugs/advert_plug.ex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/philomena_web/plugs/advert_plug.ex b/lib/philomena_web/plugs/advert_plug.ex index e2dd23f3..37a5fe04 100644 --- a/lib/philomena_web/plugs/advert_plug.ex +++ b/lib/philomena_web/plugs/advert_plug.ex @@ -22,7 +22,7 @@ defmodule PhilomenaWeb.AdvertPlug do do: Conn.assign(conn, :advert, record_impression(Adverts.random_live_for(image))) defp maybe_assign_ad(conn, _image, _false), - do: conn + do: Conn.assign(conn, :advert, nil) defp show_ads?(%{hide_advertisements: hide}), do: !hide