From 57e70e5b827e34f22bf65caa0282d85f49a45153 Mon Sep 17 00:00:00 2001 From: evazion Date: Sat, 26 Dec 2020 11:16:19 -0600 Subject: [PATCH] /users: fix exception when last_ip_addr is nil. --- app/views/users/index.html.erb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/views/users/index.html.erb b/app/views/users/index.html.erb index fde5ef637..18dfbc6c2 100644 --- a/app/views/users/index.html.erb +++ b/app/views/users/index.html.erb @@ -17,7 +17,9 @@ <% end %> <% if policy(IpAddress).show? %> <% t.column "IP" do |user| %> - <%= link_to user.last_ip_addr, ip_address_path(user.last_ip_addr) %> + <% if user.last_ip_addr.present? %> + <%= link_to user.last_ip_addr, ip_address_path(user.last_ip_addr) %> + <% end %> <% end %> <% end %> <% t.column "Posts" do |user| %>