]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
null reference error
authorEvan Prodromou <evan@prodromou.name>
Fri, 18 Jul 2008 04:20:30 +0000 (00:20 -0400)
committerEvan Prodromou <evan@prodromou.name>
Fri, 18 Jul 2008 04:20:30 +0000 (00:20 -0400)
darcs-hash:20080718042030-84dde-78e056f1e47335556d353cdf2940651f59291efd.gz

actions/twitapifriendships.php

index fe9ee2ad5f586d598f9e9da0b8a538ec22519848..29c2311b34a7a28ae417578112e4c2ab2ac0059a 100644 (file)
@@ -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