added a fix for deleted users

This commit is contained in:
Harry Bomrah 2017-07-25 15:30:17 +08:00
parent fd3f22abaa
commit e012d9d337
1 changed files with 2 additions and 2 deletions

View File

@ -43,7 +43,7 @@
<h3 class="ticket-heading">#<%= @ticket.uid %> - <%= @ticket.subject[0..50] %>
<% if !@ticket.taken_by.nil? %>
<% user = User.find(@ticket.taken_by) %>
<% if user.member_profile.avatar.nil? || user.member_profile.avatar.thumb.url == "thumb_person.png"
<% if user.nil? || user.member_profile.avatar.nil? || user.member_profile.avatar.thumb.url == "thumb_person.png"
avatar = "/assets/thumb_person.png"
else
avatar = user.member_profile.avatar.thumb.url
@ -51,7 +51,7 @@
%>
<div class="ticket-heading-avatar tool-tip-parent">
<img class="t-avatar" src="<%= avatar %>">
<span class="ticket-heading-avatar-name tool-tip"><%= user.name %></span>
<span class="ticket-heading-avatar-name tool-tip"><%= user.name rescue "Member was deleted" %></span>
</div>
<% end %>
</h3>