Use enum empty instead
[akkoma] / lib / pleroma / search / elasticsearch / document_mappings / activity.ex
index 3a84e991b023f295fc561c86b58e54736b758a31..71ef75634573a34d6b4d3fa394424e7be46af62c 100644 (file)
@@ -30,7 +30,7 @@ defimpl Elasticsearch.Document, for: Pleroma.Activity do
           trimmed
         end
 
-      if String.length(content) > 1 do
+      if String.length(content) > 1 and not is_nil(data["published"]) do
         {:ok, published, _} = DateTime.from_iso8601(data["published"])
 
         %{
@@ -57,5 +57,5 @@ end
 defimpl Elasticsearch.Document, for: Pleroma.Object do
   def id(obj), do: obj.id
   def routing(_), do: false
-  def encode(_), do: nil
+  def encode(_), do: %{}
 end