From 08736f85568643a932b7f6e96a3a231e1028c34a Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Wed, 20 Jun 2012 11:39:53 +0200 Subject: [PATCH] Improve error handling. --- app/models/user.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/models/user.rb b/app/models/user.rb index 3a49d1c34..b76c9894d 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -232,9 +232,12 @@ Your #{config.product_name} Team end location = ['street', 'zip', 'city', 'country'] - + + # get current user data + current = User.where( :id => self.id ).first + return if !current + # check if geo update is needed - current = User.find( self.id ) current_location = {} location.each { |item| current_location[item] = current[item]