Skip to content

Commit

Permalink
Speaker may not associated to user
Browse files Browse the repository at this point in the history
when speaker create by admin console
  • Loading branch information
unasuke committed Sep 20, 2024
1 parent d371d4e commit af1c822
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 af1c822

Please sign in to comment.