diff options
author | Genadi Samokovarov <gsamokovarov@gmail.com> | 2014-11-16 17:17:06 +0200 |
---|---|---|
committer | Genadi Samokovarov <gsamokovarov@gmail.com> | 2014-11-16 17:17:06 +0200 |
commit | e05714fdbc4d6a767f207b08a94ba3ebf147213e (patch) | |
tree | 9d8558c201bd4c8e27d4c4cee067c51c988ba3f8 /actionpack/lib/action_dispatch/middleware/templates/rescues | |
parent | 4b4dca48a590fe9380cc0b727788a36a8c40296f (diff) | |
download | rails-e05714fdbc4d6a767f207b08a94ba3ebf147213e.tar.gz rails-e05714fdbc4d6a767f207b08a94ba3ebf147213e.tar.bz2 rails-e05714fdbc4d6a767f207b08a94ba3ebf147213e.zip |
Don't let #{application,framework,full}_trace be nil
Those three can be nil when exception backtrace is nil. This happens and
that forced a couple of nil guards in the code. I'm proposing to make
those always return an array, even on nil backtrace.
Diffstat (limited to 'actionpack/lib/action_dispatch/middleware/templates/rescues')
-rw-r--r-- | actionpack/lib/action_dispatch/middleware/templates/rescues/_source.erb | 38 |
1 files changed, 18 insertions, 20 deletions
diff --git a/actionpack/lib/action_dispatch/middleware/templates/rescues/_source.erb b/actionpack/lib/action_dispatch/middleware/templates/rescues/_source.erb index eabac3a9d2..101cea13f9 100644 --- a/actionpack/lib/action_dispatch/middleware/templates/rescues/_source.erb +++ b/actionpack/lib/action_dispatch/middleware/templates/rescues/_source.erb @@ -1,29 +1,27 @@ -<% if @source_extract %> - <% @source_extract.each_with_index do |extract_source, index| %> - <% if extract_source[:code] %> - <div class="source <%="hidden" if @show_source_idx != index%>" id="frame-source-<%=index%>"> - <div class="info"> - Extracted source (around line <strong>#<%= extract_source[:line_number] %></strong>): - </div> - <div class="data"> - <table cellpadding="0" cellspacing="0" class="lines"> - <tr> - <td> - <pre class="line_numbers"> - <% extract_source[:code].each_key do |line_number| %> +<% @source_extract.each_with_index do |extract_source, index| %> + <% if extract_source[:code] %> + <div class="source <%="hidden" if @show_source_idx != index%>" id="frame-source-<%=index%>"> + <div class="info"> + Extracted source (around line <strong>#<%= extract_source[:line_number] %></strong>): + </div> + <div class="data"> + <table cellpadding="0" cellspacing="0" class="lines"> + <tr> + <td> + <pre class="line_numbers"> + <% extract_source[:code].each_key do |line_number| %> <span><%= line_number -%></span> - <% end %> - </pre> - </td> + <% end %> + </pre> + </td> <td width="100%"> <pre> <% extract_source[:code].each do |line, source| -%><div class="line<%= " active" if line == extract_source[:line_number] -%>"><%= source -%></div><% end -%> </pre> </td> - </tr> - </table> - </div> + </tr> + </table> </div> - <% end %> + </div> <% end %> <% end %> |