Skip to content

Commit ab871b0

Browse files
committed
fix nil deref on Player.PlayerPawnEntity()
1 parent 2af5a1a commit ab871b0

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pkg/demoinfocs/common/player.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ type Player struct {
3333
}
3434

3535
func (p *Player) PlayerPawnEntity() st.Entity {
36+
if p.Entity == nil {
37+
return nil
38+
}
39+
3640
pawn, exists := p.Entity.PropertyValue("m_hPawn")
3741
if !exists {
3842
return nil

0 commit comments

Comments
 (0)