From 3614c77d64f9ec96c9f4ed80c30ea2874e4c56d2 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Fri, 18 Jul 2008 00:20:30 -0400 Subject: [PATCH] null reference error darcs-hash:20080718042030-84dde-78e056f1e47335556d353cdf2940651f59291efd.gz --- actions/twitapifriendships.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/actions/twitapifriendships.php b/actions/twitapifriendships.php index fe9ee2ad5f..29c2311b34 100644 --- a/actions/twitapifriendships.php +++ b/actions/twitapifriendships.php @@ -145,7 +145,11 @@ class TwitapifriendshipsAction extends TwitterapiAction { return Profile::staticGet($id); } else { $user = User::staticGet('nickname', $id); - return $user->getProfile(); + if ($user) { + return $user->getProfile(); + } else { + return NULL; + } } } @@ -153,8 +157,7 @@ class TwitapifriendshipsAction extends TwitterapiAction { if (is_numeric($id)) { return User::staticGet($id); } else { - $user = User::staticGet('nickname', $id); - return $user->getProfile(); + return User::staticGet('nickname', $id); } } } \ No newline at end of file