From 7e49ee8fb5fd26d405eac4e4d168497422c6c151 Mon Sep 17 00:00:00 2001
From: Michael <heluecht@pirati.ca>
Date: Sun, 21 Nov 2021 00:44:26 +0000
Subject: [PATCH] Hopefully fix some tests

---
 include/api.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/api.php b/include/api.php
index d097c8d669..ef0e0bfbd0 100644
--- a/include/api.php
+++ b/include/api.php
@@ -3725,7 +3725,7 @@ function api_in_reply_to($item)
 	$in_reply_to['user_id_str'] = null;
 	$in_reply_to['screen_name'] = null;
 
-	if (($item['thr-parent'] != $item['uri']) && ($item['gravity'] != GRAVITY_PARENT)) {
+	if (!empty($item['thr-parent']) && ($item['thr-parent'] != $item['uri']) && ($item['gravity'] != GRAVITY_PARENT)) {
 		$parent = Post::selectFirst(['id'], ['uid' => $item['uid'], 'uri' => $item['thr-parent']]);
 		if (DBA::isResult($parent)) {
 			$in_reply_to['status_id'] = intval($parent['id']);