add check to make sure a change is submitted for display name

This commit is contained in:
robcolbert 2019-07-08 06:16:14 -04:00
parent 14f6771e77
commit d4bc274d11

View File

@ -17,7 +17,7 @@ class Settings::ProfilesController < Settings::BaseController
def update
# if verified and display_name is different, return flash error and redirect back
if @account.is_verified && @account.display_name != params[:account][:display_name]
if @account.is_verified && params[:account][:display_name] && @account.display_name != params[:account][:display_name]
flash[:alert] = 'Unable to change Display name for verified account'
redirect_to settings_profile_path
else