aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrinpatch <rinpatch@sdf.org>2019-04-29 18:33:06 +0000
committerrinpatch <rinpatch@sdf.org>2019-04-29 18:33:06 +0000
commit32a4501d2d1cdfef68cbde236482e0c84cce3a7a (patch)
tree58a6083309fd8cf7d15fcac288360b0c053f1d3f
parent41d78f91083b5017e6085150bfae71a842f5c47f (diff)
parentf8f6af4cc1e9389023c04dba0984f523704f11b1 (diff)
downloadpleroma-32a4501d2d1cdfef68cbde236482e0c84cce3a7a.tar.gz
Merge branch 'hotfix/migrateoldbookmarks-crashing-on-deleted-activities' into 'develop'
Fix MigrateOldBookmarks migration crashing on deleted activities See merge request pleroma/pleroma!1106
-rw-r--r--priv/repo/migrations/20190414125034_migrate_old_bookmarks.exs2
1 files changed, 1 insertions, 1 deletions
diff --git a/priv/repo/migrations/20190414125034_migrate_old_bookmarks.exs b/priv/repo/migrations/20190414125034_migrate_old_bookmarks.exs
index ebe69696e..134b7c6f7 100644
--- 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)