From 78f6ea94bb355b260c935e17fd2f5b2e84ccbcb7 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Thu, 20 Aug 2020 09:34:37 -0400 Subject: [PATCH] Check for parent existence in Protocol\DFRN - Address https://github.com/friendica/friendica/issues/8877#issuecomment-660263687 --- src/Protocol/DFRN.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Protocol/DFRN.php b/src/Protocol/DFRN.php index 064f1f3aca..b09c1bea0f 100644 --- a/src/Protocol/DFRN.php +++ b/src/Protocol/DFRN.php @@ -963,10 +963,12 @@ class DFRN if ($item['gravity'] != GRAVITY_PARENT) { $parent_item = (($item['thr-parent']) ? $item['thr-parent'] : $item['parent-uri']); $parent = Item::selectFirst(['guid', 'plink'], ['uri' => $parent_item, 'uid' => $item['uid']]); - $attributes = ["ref" => $parent_item, "type" => "text/html", - "href" => $parent['plink'], - "dfrn:diaspora_guid" => $parent['guid']]; - XML::addElement($doc, $entry, "thr:in-reply-to", "", $attributes); + if (DBA::isResult($parent)) { + $attributes = ["ref" => $parent_item, "type" => "text/html", + "href" => $parent['plink'], + "dfrn:diaspora_guid" => $parent['guid']]; + XML::addElement($doc, $entry, "thr:in-reply-to", "", $attributes); + } } // Add conversation data. This is used for OStatus