commit: 32a4501d2d1cdfef68cbde236482e0c84cce3a7a
parent: 41d78f91083b5017e6085150bfae71a842f5c47f
Author: rinpatch <rinpatch@sdf.org>
Date: Mon, 29 Apr 2019 18:33:06 +0000
Merge branch 'hotfix/migrateoldbookmarks-crashing-on-deleted-activities' into 'develop'
Fix MigrateOldBookmarks migration crashing on deleted activities
See merge request pleroma/pleroma!1106
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/priv/repo/migrations/20190414125034_migrate_old_bookmarks.exs b/priv/repo/migrations/20190414125034_migrate_old_bookmarks.exs
@@ -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)