sebbacon/alaveteli — Issue #333: Sometimes incoming messages evaluate to nil when viewing a request
Author: sebbacon
Created: 2012-01-10 16:16:57+00:00
State: open

This may be a race condition as later attempts to view the same request succeed.

A ActionView::TemplateError occurred in request#show:

private method `scan' called for nil:NilClass
On line #11 of app/views/request/_correspondence.rhtml

8: %>
9:

10:

11: <% if !incoming_message.safe_mail_from.nil? && incoming_message.safe_mail_from.strip != @info_request.public_body.name.strip %>
12: <%= _("From:") %> <%=h incoming_message.safe_mail_from %>

13: <% end %>
14: <% if incoming_message.safe_mail_from.nil? || (incoming_message.mail_from_domain == @info_request.public_body.request_email_domain) %>

app/models/incoming_message.rb:731:in `_uudecode_and_save_attachments'
app/models/incoming_message.rb:834:in `extract_attachments!'
app/models/incoming_message.rb:131:in `parse_raw_email!'
app/models/incoming_message.rb:170:in `mail_from'
app/models/incoming_message.rb:174:in `safe_mail_from'
app/views/request/_correspondence.rhtml:11:in `_run_rhtml_app47views47request47_correspondence46rhtml_locals_correspondence_info_request_event_object'
app/views/request/show.rhtml:126:in `_run_rhtml_app47views47request47show46rhtml'
vendor/gems/will_paginate-2.3.15/lib/will_paginate/finder.rb:168:in `method_missing'
vendor/gems/will_paginate-2.3.15/lib/will_paginate/finder.rb:168:in `method_missing'
app/views/request/show.rhtml:124:in `_run_rhtml_app47views47request47show46rhtml'
app/controllers/request_controller.rb:111:in `show'
app/controllers/request_controller.rb:110:in `show'
app/controllers/request_controller.rb:49:in `show'

* URL : http://www.whatdotheyknow.com/request/treatment_of_freedom_of_informat_2?unfold=1
* IP address: 94.23.225.68
* Parameters: {"url_title"=>"treatment_of_freedom_of_informat_2", "action"=>"show", "unfold"=>"1", "controller"=>"request"}