From 9384a6e2429d8ef9a68185c869758b1e258092c1 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Mon, 14 Dec 2009 16:40:56 -0500 Subject: [PATCH] fix error with cached repeat of deleted original in api output --- lib/api.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/api.php b/lib/api.php index 0c66501116..833bc1c5fc 100644 --- a/lib/api.php +++ b/lib/api.php @@ -224,9 +224,13 @@ class ApiAction extends Action return $base; } else { $original = Notice::staticGet('id', $notice->repeat_of); - $original_array = $this->twitterSimpleStatusArray($original, $include_user); - $original_array['retweeted_status'] = $base; - return $original_array; + if (empty($original)) { + return $base; + } else { + $original_array = $this->twitterSimpleStatusArray($original, $include_user); + $original_array['retweeted_status'] = $base; + return $original_array; + } } }