Merge branch 'nil_pinned_objects_cope' into 'develop'

Don't blow up when there are nil pinned objects on a user

Closes #49

See merge request soapbox-pub/soapbox!54
This commit is contained in:
Alex Gleason 2021-11-25 01:37:56 +00:00
commit e62d5d08f5

View file

@ -636,12 +636,14 @@ def fetch_user_activities(user, reading_user, params) do
end
defp fetch_activities_for_user(user, reading_user, params) do
pinned_object_ids = if user.pinned_objects, do: Map.keys(user.pinned_objects), else: []
params =
params
|> Map.put(:type, ["Create", "Announce"])
|> Map.put(:user, reading_user)
|> Map.put(:actor_id, user.ap_id)
|> Map.put(:pinned_object_ids, Map.keys(user.pinned_objects))
|> Map.put(:pinned_object_ids, pinned_object_ids)
params =
if User.blocks?(reading_user, user) do