summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjessib <jessib@leap.se>2013-02-19 11:14:39 -0800
committerjessib <jessib@leap.se>2013-02-19 11:14:39 -0800
commit1023cac35016bb1a89864d10ac89acabe86cf227 (patch)
tree2cadf2f851441504aacfcdb470c6533ca91f2e45
parentbb58733e065c7ff5036e75e805f1d498d0085e80 (diff)
Only check if last email alias is valid if the user has a last email alias.
-rw-r--r--users/app/controllers/users_controller.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/users/app/controllers/users_controller.rb b/users/app/controllers/users_controller.rb
index ad51354..9325bc0 100644
--- a/users/app/controllers/users_controller.rb
+++ b/users/app/controllers/users_controller.rb
@@ -34,7 +34,7 @@ class UsersController < ApplicationController
@user.attributes = params[:user]
if @user.changed? and @user.save
flash[:notice] = t(:user_updated_successfully)
- elsif !@user.email_aliases.last.valid?
+ elsif @user.email_aliases.last and !@user.email_aliases.last.valid?
@email_alias = @user.email_aliases.pop
end
respond_with @user, :location => edit_user_path(@user, :anchor => @anchor)