diff --git a/app/views/admin/surveys/answer_sets.html.erb b/app/views/admin/surveys/answer_sets.html.erb
index 9fbdc58..ecaa02f 100644
--- a/app/views/admin/surveys/answer_sets.html.erb
+++ b/app/views/admin/surveys/answer_sets.html.erb
@@ -279,6 +279,16 @@
<% answers_nil = @survey_answers.nil? %>
<% (@survey_answer_groups || @survey_answers).each do |sa| %>
+ <%
+ link_sa = sa
+ if answers_nil
+ link_sa = sa.survey_answers.last
+ if link_sa.nil?
+ sa.destroy
+ next
+ end
+ end
+ %>
<% user = sa.user.nil? ? nil : (User.find(sa.user) rescue nil) %>
<% if !user.nil? %>
<%= user.member_name rescue user.name %> |
@@ -291,7 +301,7 @@
<%= t("survey.view") %>(<%=sa.survey_answer_ids.count%>)
<% else %>
- <% sa = sa.survey_answers.last if answers_nil %>
+ <% sa = link_sa %>
<% if @survey.result_type == QuestionnaireSurvey::ResultCriteria %>
<% tmp_msgs = []
answer_model_attrs = sa.attributes