From 6c6ae7c7121a92342f96a50b1e0c75b64b80d8ff Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Tue, 22 Jun 2021 17:13:04 +0200 Subject: [PATCH] Fix resource preview crash when resource has no image_remote_url Signed-off-by: Thomas Citharel --- lib/service/rich_media/parser.ex | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/service/rich_media/parser.ex b/lib/service/rich_media/parser.ex index 6ffcb2d5f..4556d8299 100644 --- a/lib/service/rich_media/parser.ex +++ b/lib/service/rich_media/parser.ex @@ -287,7 +287,8 @@ defmodule Mobilizon.Service.RichMedia.Parser do end @spec check_remote_picture_path(map()) :: map() - defp check_remote_picture_path(%{image_remote_url: image_remote_url, url: url} = data) do + defp check_remote_picture_path(%{image_remote_url: image_remote_url, url: url} = data) + when is_binary(image_remote_url) and is_binary(url) do Logger.debug("Checking image_remote_url #{image_remote_url}") data = Map.put(data, :image_remote_url, format_url(url, image_remote_url))