Skip to content
Snippets Groups Projects
Commit f8f6af4c authored by rinpatch's avatar rinpatch :speech_balloon:
Browse files

Fix MigrateOldBookmarks migration crashing on deleted activities

parent 41d78f91
No related branches found
No related tags found
No related merge requests found
......@@ -18,7 +18,7 @@ def change 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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment