FIX: Prevent error when primary email is missing (#11446)

This commit is contained in:
Gerhard Schlager 2020-12-09 18:14:45 +01:00 committed by GitHub
parent b572ca6da0
commit 538e1142e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -1240,7 +1240,7 @@ class User < ActiveRecord::Base
end
def email
primary_email.email
primary_email&.email
end
def email=(new_email)

View File

@ -369,7 +369,7 @@ class UserMerger
def log_merge
logger = StaffActionLogger.new(@acting_user || Discourse.system_user)
logger.log_user_merge(@target_user, @source_user.username, @source_primary_email)
logger.log_user_merge(@target_user, @source_user.username, @source_primary_email || "")
end
def update_user_id(table_name, opts = {})