Skip to content

Commit

Permalink
fix: nil pointer dereference on server identifier
Browse files Browse the repository at this point in the history
  • Loading branch information
RoyXiang committed Mar 10, 2022
1 parent 865b9d5 commit 5d769e3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions handler/plex.go
Original file line number Diff line number Diff line change
Expand Up @@ -416,9 +416,10 @@ func (c *PlexClient) getServerIdentifier() string {
defer c.mu.RUnlock()

identity, err := c.client.GetServerIdentity()
if err == nil {
c.serverIdentifier = &identity.MediaContainer.MachineIdentifier
if err != nil {
return ""
}
c.serverIdentifier = &identity.MediaContainer.MachineIdentifier
}
return *c.serverIdentifier
}
Expand Down

0 comments on commit 5d769e3

Please sign in to comment.