]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/OStatus/scripts/update-profile-data.php
Ostatus_profile throws NoProfileException from localProfile()
[quix0rs-gnu-social.git] / plugins / OStatus / scripts / update-profile-data.php
index bca71b6258f2eb63a79d22276d61fa198614a206..116061a7c3bc626183a4a74d163da67bc558af5d 100644 (file)
@@ -38,13 +38,17 @@ END_OF_HELP;
 
 require_once INSTALLDIR.'/scripts/commandline.inc';
 
-function showProfileInfo($oprofile) {
+function showProfileInfo(Ostatus_profile $oprofile) {
     if ($oprofile->isGroup()) {
         echo "group\n";
     } else {
         $profile = $oprofile->localProfile();
-        foreach (array('nickname', 'bio', 'homepage', 'location') as $field) {
-            print "  $field: {$profile->$field}\n";
+        try {
+            foreach (array('nickname', 'bio', 'homepage', 'location') as $field) {
+                print "  $field: {$profile->$field}\n";
+            }
+        } catch (NoProfileException $e) {
+            print "local profile not found";
         }
     }
     echo "\n";