instanceof checks for better typing
This commit is contained in:
parent
915d329b5a
commit
9edde007b1
@ -1466,7 +1466,7 @@ class ApiAction extends Action
|
||||
} else if ($this->arg('screen_name')) {
|
||||
$nickname = common_canonical_nickname($this->arg('screen_name'));
|
||||
$user = User::getKV('nickname', $nickname);
|
||||
return $user ? $user->getProfile() : null;
|
||||
return $user instanceof User ? $user->getProfile() : null;
|
||||
} else {
|
||||
// Fall back to trying the currently authenticated user
|
||||
return $this->scoped;
|
||||
|
@ -30,7 +30,7 @@ class ApiGNUsocialOAuthDataStore extends OAuthDataStore
|
||||
{
|
||||
$con = Consumer::getKV('consumer_key', $consumerKey);
|
||||
|
||||
if (!$con) {
|
||||
if (!$con instanceof Consumer) {
|
||||
|
||||
// Create an anon consumer and anon application if one
|
||||
// doesn't exist already
|
||||
|
Loading…
Reference in New Issue
Block a user