From 261ec824515c1de6d93ad1c4ca7d3cf73faa58a4 Mon Sep 17 00:00:00 2001 From: Roger Braun Date: Tue, 24 Oct 2017 08:39:24 +0200 Subject: [PATCH] Return nil for nil object requests. --- lib/pleroma/object.ex | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/pleroma/object.ex b/lib/pleroma/object.ex index 5b51d6be3..3c42c7cb5 100644 --- a/lib/pleroma/object.ex +++ b/lib/pleroma/object.ex @@ -21,6 +21,7 @@ defmodule Pleroma.Object do |> unique_constraint(:ap_id, name: :objects_unique_apid_index) end + def get_by_ap_id(nil), do: nil def get_by_ap_id(ap_id) do Repo.one(from object in Object, where: fragment("? @> ?", object.data, ^%{id: ap_id}))