diff options
author | Louise Crow <louise.crow@gmail.com> | 2012-11-15 12:03:11 +0000 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2012-11-15 12:03:11 +0000 |
commit | 685938f1d736c54663011274ca563ba94d0e49b0 (patch) | |
tree | f08463ea7d6577884c1112c112a525b18db9f391 | |
parent | 4a157dc80daf5998f0ec82aaf274b546e4053449 (diff) |
Fix for reference to nil object. Fixes https://github.com/mysociety/alaveteli/issues/705.
-rw-r--r-- | app/views/request/_correspondence.rhtml | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/app/views/request/_correspondence.rhtml b/app/views/request/_correspondence.rhtml index bcfc93657..99c6c7d26 100644 --- a/app/views/request/_correspondence.rhtml +++ b/app/views/request/_correspondence.rhtml @@ -1,5 +1,5 @@ <div class="ff-print-fix"></div> -<% +<% if !info_request_event.nil? && info_request_event.event_type == 'response' incoming_message = info_request_event.incoming_message end @@ -21,9 +21,9 @@ if not incoming_message.nil? <p class="event_actions"> <% if !@user.nil? && @user.admin_page_links? %> - <%= link_to "Admin", admin_url("request/show_raw_email/" + incoming_message.raw_email_id.to_s) %> | + <%= link_to "Admin", admin_url("request/show_raw_email/" + incoming_message.raw_email_id.to_s) %> | <% end %> - <%= link_to _("Link to this"), incoming_message_url(incoming_message), :class => "link_to_this" %> + <%= link_to _("Link to this"), incoming_message_url(incoming_message), :class => "link_to_this" %> </p> </div> <% @@ -39,28 +39,28 @@ elsif [ 'sent', 'followup_sent' ].include?(info_request_event.event_type) <%= render :partial => 'bubble', :locals => { :body => outgoing_message.get_body_for_html_display(), :attachments => nil } %> - <p class="event_actions"> + <p class="event_actions"> <% if outgoing_message.status == 'ready' && !@info_request.is_external? %> <strong>Warning:</strong> This message has <strong>not yet been sent</strong> for an unknown reason. - <% end %> + <% end %> <!-- Can use this to get name of who followup was too, if say you play with proper from display, but not sure needed <% if outgoing_message.message_type == 'followup' && !outgoing_message.incoming_message_followup.nil? && !outgoing_message.incoming_message_followup.safe_mail_from.nil? %> - Follow up sent to: <%=h outgoing_message.incoming_message_followup.safe_mail_from %> - <% end %> + Follow up sent to: <%=h outgoing_message.incoming_message_followup.safe_mail_from %> + <% end %> --> - <%= link_to _("Link to this"), outgoing_message_url(outgoing_message), :class => "link_to_this" %> + <%= link_to _("Link to this"), outgoing_message_url(outgoing_message), :class => "link_to_this" %> </p> </div> <% elsif [ 'resent', 'followup_resent' ].include?(info_request_event.event_type) %> - <div class="outgoing correspondence" id="outgoing-<%=outgoing_message.id.to_s%>"> + <div class="outgoing correspondence" id="outgoing-<%=info_request_event.outgoing_message.id.to_s%>"> <h2> <%= simple_date(info_request_event.created_at) %> </h2> - <p class="event_plain"> - Sent + <p class="event_plain"> + Sent <% if info_request_event.outgoing_message.message_type == 'initial_request' %> request <% elsif info_request_event.outgoing_message.message_type == 'followup' %> @@ -72,7 +72,7 @@ elsif [ 'sent', 'followup_sent' ].include?(info_request_event.event_type) to <%= public_body_link(@info_request.public_body) %> again<% if not info_request_event.same_email_as_previous_send? %>, using a new contact address<% end %>. </p> </div> -<% elsif info_request_event.event_type == 'comment' +<% elsif info_request_event.event_type == 'comment' comment = info_request_event.comment %> <%= render :partial => 'comment/single_comment', :locals => { :comment => comment } %> |