aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorThurloat <thurloat@gmail.com>2018-09-02 20:44:37 -0300
committerThurloat <thurloat@gmail.com>2018-09-02 20:44:37 -0300
commit4257f784bc8e742888e978fccbab0f566c549376 (patch)
tree05589df3fa5cc1cf35258615fb23d80ac6878aca /lib
parenta9c0f395cb4d854e552a3205cb5b38ff610f8e27 (diff)
downloadpleroma-4257f784bc8e742888e978fccbab0f566c549376.tar.gz
sloop around get_emoji/1 to check is_binary and have a fallthrough
default that returns empty
Diffstat (limited to 'lib')
-rw-r--r--lib/pleroma/formatter.ex6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/pleroma/formatter.ex b/lib/pleroma/formatter.ex
index fc2c643da..e5ccc7a49 100644
--- a/lib/pleroma/formatter.ex
+++ b/lib/pleroma/formatter.ex
@@ -157,12 +157,12 @@ defmodule Pleroma.Formatter do
end)
end
- def get_emoji(nil), do: []
-
- def get_emoji(text) do
+ def get_emoji(text) when is_binary(text) do
Enum.filter(@emoji, fn {emoji, _} -> String.contains?(text, ":#{emoji}:") end)
end
+ def get_emoji(_), do: []
+
def get_custom_emoji() do
@emoji
end