Skip to content

Commit

Permalink
Merge pull request #28 from unasuke/speaker-created-by-admin
Browse files Browse the repository at this point in the history
Speaker may not associated to user
  • Loading branch information
unasuke authored Sep 20, 2024
2 parents daa6497 + af1c822 commit f2d7547
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions app/decorators/speaker_decorator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ def social_account

def link_to_github
case
when user.provider == "github"
when user&.provider == "github"
uname = github_uid_to_uname user.uid
h.link_to "@#{uname}", "https://github.com/#{uname}", target: '_blank'
when user.github_account.present?
when user&.github_account.present?
h.link_to "@#{user.github_account}", "https://github.com/#{user.github_account}", target: '_blank'
else
'none'
Expand Down
2 changes: 1 addition & 1 deletion app/models/speaker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def gravatar_hash
end

def github_account
user.github_account
user&.github_account
end
end

Expand Down

0 comments on commit f2d7547

Please sign in to comment.