aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMaksim Pechnikov <parallel588@gmail.com>2018-12-14 22:56:37 +0300
committerMaksim Pechnikov <parallel588@gmail.com>2018-12-14 23:16:12 +0300
commitea72ac549b2ac52623462d6862154fb6f800c01c (patch)
treec6c1cfc6cc6e478311b480c2408e92494702caba /lib
parentd3ec09bb380bb990bea6edc5dae6bbda7f2322c5 (diff)
downloadpleroma-ea72ac549b2ac52623462d6862154fb6f800c01c.tar.gz
fix case when tags is invalid
Diffstat (limited to 'lib')
-rw-r--r--lib/pleroma/web/mastodon_api/views/status_view.ex4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/pleroma/web/mastodon_api/views/status_view.ex b/lib/pleroma/web/mastodon_api/views/status_view.ex
index f2a47f594..46c559e3a 100644
--- a/lib/pleroma/web/mastodon_api/views/status_view.ex
+++ b/lib/pleroma/web/mastodon_api/views/status_view.ex
@@ -244,8 +244,10 @@ defmodule Pleroma.Web.MastodonAPI.StatusView do
{"name": "nextcloud", "url": "/tag/nextcloud"}]
"""
- @spec build_tags(list(String.t())) :: list(map())
+ @spec build_tags(list(any())) :: list(map())
def build_tags(object_tags) when is_list(object_tags) do
+ object_tags = for tag when is_binary(tag) <- object_tags, do: tag
+
Enum.reduce(object_tags, [], fn tag, tags ->
tags ++ [%{name: tag, url: "/tag/#{tag}"}]
end)