From 18b173d5c6715eaf052a979984622f867661cd7b Mon Sep 17 00:00:00 2001 From: s1lentq Date: Sun, 8 Dec 2024 05:15:11 +0700 Subject: [PATCH] Fix potential crash --- rehlds/engine/sv_main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rehlds/engine/sv_main.cpp b/rehlds/engine/sv_main.cpp index b6c870e..20ba978 100644 --- a/rehlds/engine/sv_main.cpp +++ b/rehlds/engine/sv_main.cpp @@ -6076,7 +6076,7 @@ void PrecacheModelSounds(studiohdr_t *pStudioHeader) void PrecacheModelSpecifiedFiles() { const char **s = &g_psv.model_precache[1]; - for (size_t i = 1; i < ARRAYSIZE(g_psv.model_precache) && *s != nullptr; i++, s++) + for (size_t i = 1; i < ARRAYSIZE(g_psv.model_precache) && *s && g_psv.models[i]; i++, s++) { if (g_psv.models[i]->type != mod_studio) continue;