From b030cdb4e34f306dbfd8aea0ab7c3a87335c0b23 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Tue, 3 Dec 2024 21:56:06 +0300 Subject: [PATCH] engine: client: add NULL check to prevent crash if in_graph key doesn't exist in client.dll --- engine/client/cl_netgraph.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/engine/client/cl_netgraph.c b/engine/client/cl_netgraph.c index 6945f12e0..7dc79b178 100644 --- a/engine/client/cl_netgraph.c +++ b/engine/client/cl_netgraph.c @@ -657,18 +657,11 @@ void SCR_DrawNetGraph( void ) in_graph = clgame.dllFuncs.KB_Find( "in_graph" ); - if( in_graph->state & 1 ) - { + if( in_graph && in_graph->state & 1 ) graphtype = 2; - } else if( net_graph.value != 0.0f ) - { graphtype = (int)net_graph.value; - } - else - { - return; - } + else return; if( net_scale.value <= 0 ) Cvar_SetValue( "net_scale", 0.1f );