Przeglądaj źródła

Update AP Profile Transformer, fix movedTo attribute

Daniel Supernault 1 rok temu
rodzic
commit
63100fe950

+ 4 - 1
app/Transformer/ActivityPub/ProfileTransformer.php

@@ -65,7 +65,10 @@ class ProfileTransformer extends Fractal\TransformerAbstract
             }
             }
 
 
             if ($profile->moved_to_profile_id) {
             if ($profile->moved_to_profile_id) {
-                $res['movedTo'] = AccountService::get($profile->moved_to_profile_id)['url'];
+                $movedTo = AccountService::get($profile->moved_to_profile_id);
+                if ($movedTo && isset($movedTo['url'], $movedTo['id'])) {
+                    $res['movedTo'] = $movedTo['url'];
+                }
             }
             }
         }
         }