tolerate missing communication channels in user split

refs FOO-2501
flag = none

test plan:
- merge two users with communication channels
- hard delete one of the channels
- split the users
- it should work

Change-Id: I417446cc96e7391dd9d262505ac35b59ab0a333e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/276324
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: August Thornton <august@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: August Thornton <august@instructure.com>
This commit is contained in:
Simon Williams 2021-10-19 22:18:06 -05:00
parent 008474310b
commit d51c6def4e
1 changed files with 1 additions and 1 deletions

View File

@ -227,7 +227,7 @@ class SplitUsers
target_cc = cr.context
# if this cc didn't get moved, we don't need to worry
# about deconflicting it with the source users.
next unless target_cc.user_id == source_user.id
next unless target_cc&.user_id == source_user.id
conflict_cc = restored_user.communication_channels.detect do |c|
c.path.downcase == target_cc.path.downcase && c.path_type == target_cc.path_type