From: Tom Hughes Date: Fri, 12 Oct 2007 13:03:08 +0000 (+0000) Subject: Don't try and print the distance to a friend that has not set a X-Git-Tag: live~8056 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/b74477a57ce474fa95913fd637c20a400426d7b8?ds=sidebyside Don't try and print the distance to a friend that has not set a home location. Closes #560. --- diff --git a/app/views/user/view.rhtml b/app/views/user/view.rhtml index 93bed72b0..a96fd5b19 100644 --- a/app/views/user/view.rhtml +++ b/app/views/user/view.rhtml @@ -38,7 +38,7 @@ <% @friend = User.find_by_id(friend.friend_user_id) %> <%= link_to @friend.display_name, :controller => 'user', :action => 'view', :display_name => @friend.display_name %> - <%= @this_user.distance(@friend).round %>km away + <% if @friend.home_lon and @friend.home_lat %><%= @this_user.distance(@friend).round %>km away<% end %> (<%= link_to 'send message', :controller => 'message', :action => 'new', :user_id => @friend.id %>) <%end%>