From: Tom Hughes Date: Tue, 2 Mar 2010 16:42:45 +0000 (+0000) Subject: Don't try and show distances to friends if the user has no X-Git-Tag: live~6337^2~54 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/0813f88bc7972e175c4492a07a00916fc11c3e88 Don't try and show distances to friends if the user has no home location set. Closes #2766. --- diff --git a/app/views/user/_contact.html.erb b/app/views/user/_contact.html.erb index f019ccf15..e0babce7e 100644 --- a/app/views/user/_contact.html.erb +++ b/app/views/user/_contact.html.erb @@ -4,7 +4,7 @@ <%= link_to h(contact.display_name), :controller => 'user', :action => 'view', :display_name => contact.display_name %> - <% if contact.home_lon and contact.home_lat %> + <% if @this_user.home_lon and @this_user.home_lat and contact.home_lon and contact.home_lat %> <% distance = @this_user.distance(contact) %> <% if distance < 1 %> (<%= t 'user.view.m away', :count => (distance * 1000).round %>)