Skip to content

Commit 1538d37

Browse files
committed
fix(player): EnsureCustomView crash on PostTeam
1 parent 185a628 commit 1538d37

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/player/player/Player.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,7 @@ CBaseViewModel* Player::EnsureCustomView(int index)
431431
if(GetPlayerController()->m_bControllingBot()) {
432432
return nullptr;
433433
} else {
434+
if(!GetPawn()->m_pObserverServices()) return nullptr;
434435
auto observerPawn = GetPawn()->m_pObserverServices->m_hObserverTarget();
435436
if(!observerPawn) return nullptr;
436437

@@ -444,6 +445,7 @@ CBaseViewModel* Player::EnsureCustomView(int index)
444445
}
445446
}
446447
if(!pPawnBase) return nullptr;
448+
if(!pPawnBase->m_pViewModelServices()) return nullptr;
447449

448450
CBaseViewModel* pViewModel = pPawnBase->m_pViewModelServices()->GetViewModel(index);
449451
if (!pViewModel) {

0 commit comments

Comments
 (0)