diff options
author | jomo <github@jomo.tv> | 2016-06-12 00:44:39 +0200 |
---|---|---|
committer | jomo <github@jomo.tv> | 2016-06-12 00:44:39 +0200 |
commit | 44839b08ae1ad1f5c2e837c5d6130496da287cce (patch) | |
tree | d1277caf1924e9247a320b467ae5c4d5e44f90a8 | |
parent | 8beb2d39db57661ff156cdb2981588fa962065c2 (diff) |
fix syntax error when deleting invalid role from POST params
-rw-r--r-- | app/controllers/users_controller.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index ea56ebf..ae9424e 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -147,11 +147,11 @@ class UsersController < ApplicationController end if userdata[:role] role = Role.get(userdata[:role]) - if role <= current_user.role + if role && role <= current_user.role userdata[:role] = role else # don't change role - userdata.delete[:role] + userdata.delete(:role) end end if @user.youtube != userdata[:youtube] |