about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2018-05-31 02:30:37 +0200
committerGitHub <noreply@github.com>2018-05-31 02:30:37 +0200
commitc61c4565ab17f7e882b93f96e4d97ff1681a7bcf (patch)
tree955780025f6fabd1ef200710a2ad0410f84f82f0
parentad40bf5e0c77baacbeda248ccca8d310e786ff61 (diff)
Fix nil error in migration (#7680)
Under rare circumstances the user record could have already been deleted before...
-rw-r--r--db/migrate/20180528141303_fix_accounts_unique_index.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/db/migrate/20180528141303_fix_accounts_unique_index.rb b/db/migrate/20180528141303_fix_accounts_unique_index.rb
index 92e490f9e..aadb5b7db 100644
--- a/db/migrate/20180528141303_fix_accounts_unique_index.rb
+++ b/db/migrate/20180528141303_fix_accounts_unique_index.rb
@@ -49,7 +49,7 @@ class FixAccountsUniqueIndex < ActiveRecord::Migration[5.2]
         # are always either going to be local or not local, so only
         # one check is needed. Since we cannot support two users with
         # the same username locally, one has to go. 😢
-        other_account.user.destroy
+        other_account.user&.destroy
       end
 
       other_account.destroy