Handle errors when fetching actor pictures

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2021-11-16 15:48:09 +01:00
parent f35db6540b
commit 5b85d96e06
No known key found for this signature in database
GPG key ID: A061B9DDE0CA0773

View file

@ -149,6 +149,8 @@ defmodule Mobilizon.Federation.ActivityStream.Converter.Actor do
name <- name || Parser.get_filename_from_response(response_headers, url) || default_name, name <- name || Parser.get_filename_from_response(response_headers, url) || default_name,
{:ok, file} <- Upload.store(%{body: body, name: name}) do {:ok, file} <- Upload.store(%{body: body, name: name}) do
Map.take(file, [:content_type, :name, :url, :size]) Map.take(file, [:content_type, :name, :url, :size])
else
_ -> nil
end end
end end