From d135c88f1712d9eae78553f1ff310910ffb51cf8 Mon Sep 17 00:00:00 2001 From: AkiVer Date: Mon, 19 May 2025 01:54:13 +0200 Subject: [PATCH] fix: panic in bomb m_bStartedArming prop update handler https://github.com/akiver/cs-demo-analyzer/issues/23 the planter controller handle may be invalid --- pkg/demoinfocs/datatables.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pkg/demoinfocs/datatables.go b/pkg/demoinfocs/datatables.go index d6433ca4e..778770754 100644 --- a/pkg/demoinfocs/datatables.go +++ b/pkg/demoinfocs/datatables.go @@ -115,8 +115,11 @@ func (p *parser) bindBomb() { if p.isSource2() { planterHandle := bombEntity.PropertyValueMust("m_hOwnerEntity").Handle() ctlHandle := p.gameState.entities[entityIDFromHandle(planterHandle, true)].PropertyValueMust("m_hController").Handle() - ctlID := p.gameState.entities[entityIDFromHandle(ctlHandle, true)].ID() - planter := p.gameState.playersByEntityID[ctlID] + ctl := p.gameState.entities[entityIDFromHandle(ctlHandle, true)] + if ctl == nil { + return + } + planter := p.gameState.playersByEntityID[ctl.ID()] planter.IsPlanting = true p.gameState.currentPlanter = planter