]> cat aescling's git repositories - mastodon.git/commitdiff
Fix setting up fields of a previously suspended account (#10222)
authorThibG <thib@sitedethib.com>
Fri, 8 Mar 2019 18:59:08 +0000 (19:59 +0100)
committerEugen Rochko <eugen@zeonfederated.com>
Fri, 8 Mar 2019 18:59:08 +0000 (19:59 +0100)
Fix #10177 for real

app/models/account.rb

index b1abd8f0d81b9d7110923a9867303c073001ba34..b81c641820eaaef2b002a962cc80e3450051cf7a 100644 (file)
@@ -266,6 +266,7 @@ class Account < ApplicationRecord
     return if fields.size >= DEFAULT_FIELDS_SIZE
 
     tmp = self[:fields] || []
+    tmp = [] if tmp.is_a?(Hash)
 
     (DEFAULT_FIELDS_SIZE - tmp.size).times do
       tmp << { name: '', value: '' }