sloop around get_emoji/1 to check is_binary and have a fallthrough
[akkoma] / lib / pleroma / formatter.ex
index cf2944c38fffa668ba6526dfd415af9ea10458ef..e5ccc7a493cee9f60a67a12b16cda6ca709b62b6 100644 (file)
@@ -157,10 +157,12 @@ defmodule Pleroma.Formatter do
     end)
   end
 
-  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