Skip to content

Commit 66acec7

Browse files
authored
fixed bug when contributor.name is blank for api submission (#2624)
1 parent 4a3bb8b commit 66acec7

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

app/controllers/api/v1/plans_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ def contributor_to_user(contributor:)
141141
return user if user.present?
142142

143143
# If the user was not found, invite them and attach any know identifiers
144-
names = contributor.name.split
144+
names = contributor.name&.split || [""]
145145
firstname = names.length > 1 ? names.first : nil
146146
surname = names.length > 1 ? names.last : names.first
147147
user = User.invite!({ email: contributor.email,

0 commit comments

Comments
 (0)