Fix undefined method for NilClass error.

This commit is contained in:
Guo Xiang Tan 2017-12-12 18:54:03 +08:00
parent af3c153687
commit e2b64257b3

View File

@ -485,7 +485,7 @@ class UsersController < ApplicationController
render json: {
success: false,
message: @error,
errors: @user&.errors.to_hash,
errors: @user&.errors&.to_hash,
is_developer: UsernameCheckerService.is_developer?(@user.email),
admin: @user.admin?
}