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
1 changed files with 2 additions and 0 deletions

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,
{:ok, file} <- Upload.store(%{body: body, name: name}) do
Map.take(file, [:content_type, :name, :url, :size])
else
_ -> nil
end
end