Skip to content

Commit

Permalink
[webui] do not crash on requests with files renamed (without diff)
Browse files Browse the repository at this point in the history
  • Loading branch information
coolo committed Nov 8, 2012
1 parent 3207111 commit 4c2371d
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/webui/app/views/shared/_sourcediff.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,13 @@
<tbody>
<% last_file_id = nil %>
<% filenames.each_with_index do |filename, index| %>
<% file_element = files[filename] %>
<% file_id = "#{valid_xml_id(filename)}_#{css_id}_#{index}" %>
<% file_diff_text = file_element['diff']['_content'] || '' %>
<% file_state = file_element['state'].capitalize %>
<% is_expanded = file_state != 'Deleted' && !filename.include?('/') && (filename == '_patchinfo' || filename.ends_with?('.spec') || filename.ends_with?('.changes')) %>
<% file_element = files[filename]
file_id = "#{valid_xml_id(filename)}_#{css_id}_#{index}"
file_diff_text = ''
file_diff_text = file_element['diff']['_content'] if file_element.has_key? 'diff'
file_state = file_element['state'].capitalize
is_expanded = file_state != 'Deleted' && !filename.include?('/') && (filename == '_patchinfo' || filename.ends_with?('.spec') || filename.ends_with?('.changes'))
%>
<tr id="diff_headline_<%= file_id %>">
<td style="width: 16px"><%# NOTE: Hand-crafted value for both '[+]' and '[-]' %>
<% if file_diff_text.length > 0 %>
Expand Down

0 comments on commit 4c2371d

Please sign in to comment.