From 2ad2a4347f4ca451e4b2bf8e2ec8a01976fe3001 Mon Sep 17 00:00:00 2001 From: Luna D Date: Mon, 11 Oct 2021 19:36:29 +0200 Subject: [PATCH] account for cases when body may be nil --- lib/philomena_web/markdown_renderer.ex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/philomena_web/markdown_renderer.ex b/lib/philomena_web/markdown_renderer.ex index 2b29729d..bf6e355c 100644 --- a/lib/philomena_web/markdown_renderer.ex +++ b/lib/philomena_web/markdown_renderer.ex @@ -16,12 +16,12 @@ defmodule PhilomenaWeb.MarkdownRenderer do representations = collection |> Enum.flat_map(fn %{body: text} -> - find_images(text) + find_images(text || "") end) |> render_representations(conn) Enum.map(collection, fn %{body: text} -> - Markdown.to_html(text, representations) + Markdown.to_html(text || "", representations) end) end