Skip to content

Commit

Permalink
Fix potential nil dereference panic (#532)
Browse files Browse the repository at this point in the history
  • Loading branch information
streamer45 authored Sep 29, 2023
1 parent da50993 commit c43feb8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion server/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,12 @@ func (p *Plugin) setHandlerID(nodeID string) error {

func (p *Plugin) getNotificationNameFormat(userID string) string {
config := p.API.GetConfig()
if !*config.PrivacySettings.ShowFullName {
if config == nil {
p.LogError("failed to get config")
return model.ShowUsername
}

if config.PrivacySettings.ShowFullName == nil || !*config.PrivacySettings.ShowFullName {
return model.ShowUsername
}

Expand Down

0 comments on commit c43feb8

Please sign in to comment.