From: Haelwenn (lanodan) Monnier Date: Fri, 4 Sep 2020 05:52:22 +0000 (+0200) Subject: Prevent AccountView and instance.get_or_update_favicon fails X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=0d91f65284f99bded89c0400e976e0ffa5bc202f;p=akkoma Prevent AccountView and instance.get_or_update_favicon fails --- diff --git a/lib/pleroma/instances/instance.ex b/lib/pleroma/instances/instance.ex index 711c42158..ef5d17de4 100644 --- a/lib/pleroma/instances/instance.ex +++ b/lib/pleroma/instances/instance.ex @@ -145,6 +145,8 @@ defmodule Pleroma.Instances.Instance do favicon end + rescue + _ -> nil end defp scrape_favicon(%URI{} = instance_uri) do @@ -159,7 +161,8 @@ defmodule Pleroma.Instances.Instance do |> Floki.attribute("link[rel=icon]", "href") |> List.first(), favicon <- URI.merge(instance_uri, favicon_rel) |> to_string(), - true <- is_binary(favicon) do + true <- is_binary(favicon), + true <- String.length(favicon) <= 255 do favicon else _ -> nil