1
0
mirror of https://git.pleroma.social/sjw/pleroma.git synced 2024-12-25 02:15:16 +01:00

Fix MigrateOldBookmarks migration crashing on deleted activities

This commit is contained in:
rinpatch 2019-04-29 21:25:30 +03:00
parent 41d78f9108
commit f8f6af4cc1

View File

@ -18,7 +18,7 @@ defmodule Pleroma.Repo.Migrations.MigrateOldBookmarks do
|> Enum.each(fn %{id: user_id, bookmarks: bookmarks} ->
Enum.each(bookmarks, fn ap_id ->
activity = Activity.get_create_by_object_ap_id(ap_id)
{:ok, _} = Bookmark.create(user_id, activity.id)
unless is_nil(activity), do: {:ok, _} = Bookmark.create(user_id, activity.id)
end)
end)