From d23ae89574a81baabe5211042c14b5794539d071 Mon Sep 17 00:00:00 2001 From: SanyaSho <68691958+SanyaSho@users.noreply.github.com> Date: Fri, 7 Apr 2023 17:57:47 +0300 Subject: [PATCH] game: add another NULL check for CEngineSprite::GetMaterial --- game/client/spritemodel.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/game/client/spritemodel.cpp b/game/client/spritemodel.cpp index 018e918f..ab28e640 100644 --- a/game/client/spritemodel.cpp +++ b/game/client/spritemodel.cpp @@ -417,6 +417,9 @@ IMaterial *CEngineSprite::GetMaterial( RenderMode_t nRenderMode, int nFrame ) IMaterial *pMaterial = m_material[nRenderMode]; + if( !pMaterial ) + return NULL; + IMaterialVar* pFrameVar = pMaterial->FindVarFast( "$frame", &frameCache ); if ( pFrameVar ) { @@ -539,4 +542,4 @@ void CEngineSprite::DrawFrameOfSize( RenderMode_t nRenderMode, int frame, int x, meshBuilder.End(); pMesh->Draw(); -} \ No newline at end of file +}