Avoid a notice in twitter.php
authorMichael <heluecht@pirati.ca>
Sat, 27 Oct 2018 12:40:59 +0000 (12:40 +0000)
committerMichael <heluecht@pirati.ca>
Sat, 27 Oct 2018 12:40:59 +0000 (12:40 +0000)
twitter/twitter.php

index d3440d5..f60625e 100644 (file)
@@ -1801,6 +1801,9 @@ function twitter_fetch_own_contact(App $a, $uid)
                // Fetching user data
                // get() may throw TwitterOAuthException, but we will catch it later
                $user = $connection->get('account/verify_credentials');
+               if (empty($user) || empty($user->id_str)) {
+                       return false;
+               }
 
                PConfig::set($uid, 'twitter', 'own_id', $user->id_str);