Skip to content

Division by zero in app/helpers/blame_helper.rb

https://sentry.gitlap.com/gitlab/gitlabcom/issues/37740/

ZeroDivisionError: divided by 0
  app/helpers/blame_helper.rb:18:in `/'
    age_group = [(10 * commit_date_days_ago) / duration[:started_days_ago], 9].min
  app/helpers/blame_helper.rb:18:in `age_map_class'
    age_group = [(10 * commit_date_days_ago) / duration[:started_days_ago], 9].min
  app/views/projects/blame/show.html.haml:20:in `block in _app_views_projects_blame_show_html_haml___3368845656494177788_69843162225660'
    %td.blame-commit{ class: age_map_class(commit.committed_date, project_duration) }
  app/views/projects/blame/show.html.haml:17:in `each'
    - @blame_groups.each do |blame_group|
  app/views/projects/blame/show.html.haml:17:in `_app_views_projects_blame_show_html_haml___3368845656494177788_69843162225660'
    - @blame_groups.each do |blame_group|
...
(151 additional frame(s) were not displayed)

ActionView::Template::Error: divided by 0

ActionView::Template::Error: divided by 0