Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • G gitlabhq1
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 21
    • Issues 21
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 12
    • Merge requests 12
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Infrastructure Registry
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • gpt
  • large_projects
  • gitlabhq1
  • Issues
  • #189

Closed
Open
Created Dec 12, 2011 by Administrator@rootOwner

Handle Commits without Email

Created by: mutewinter

I get the following error when GitLabHQ tries to parse a commit message without an email.

ActionView::Template::Error (Sorry, we can't guess the encoding on a nil object):
    1: %a.project-update{:href => dashboard_feed_path(project, update)}
    2:   = image_tag gravatar_icon(update.author_email), :class => "left", :width => 40
    3:   %span.update-title
    4:     = dashboard_feed_title(update)
    5:   %span.update-author
  lib/utils.rb:21:in `encode'
  app/models/commit.rb:33:in `author_email'
  app/views/projects/_feed.html.haml:2:in `_app_views_projects__feed_html_haml___4602359052882356175_49395020'
  app/views/projects/show.html.haml:9:in `block in _app_views_projects_show_html_haml__37675904477004384_47715740'
  app/views/projects/show.html.haml:8:in `each'
  app/views/projects/show.html.haml:8:in `_app_views_projects_show_html_haml__37675904477004384_47715740'

The culprit is app/models/commit.rb:33

Here's the fix I used for this problem

  def author_email
    if author.email
      encode(author.email)
    else
      ''
    end
  end
Assignee
Assign to
Time tracking