From 0709757e47a546225163482474a46e8bc3d09837 Mon Sep 17 00:00:00 2001 From: Roman Chvanikov Date: Tue, 14 Jan 2020 19:53:28 +0300 Subject: [PATCH] Check if object->data is array when looking up attachment objects to delete --- lib/pleroma/object.ex | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/pleroma/object.ex b/lib/pleroma/object.ex index 2452a7389..6c56a9c62 100644 --- a/lib/pleroma/object.ex +++ b/lib/pleroma/object.ex @@ -203,7 +203,8 @@ defmodule Pleroma.Object do from(o in Object, where: fragment( - "to_jsonb(array(select jsonb_array_elements((?)#>'{url}') ->> 'href'))::jsonb \\?| (?)", + "to_jsonb(array(select jsonb_array_elements((?)#>'{url}') ->> 'href' where jsonb_typeof((?)#>'{url}') = 'array'))::jsonb \\?| (?)", + o.data, o.data, ^hrefs ) -- 2.45.2