Skip to content

Commit 45dff66

Browse files
committed
Don't crash when updating user without email
1 parent 9d0b37f commit 45dff66

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

app/controllers/api/v8/users_controller.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ def set_email
158158

159159
def update_email
160160
user_params = params[:user]
161+
return unless user_params[:email]
161162
new_email = user_params[:email].strip
162163
if new_email.blank?
163164
@user.errors.add(:email, 'needed')

0 commit comments

Comments
 (0)