Check return value of GetPlayerNetInfo (bug 4315, r=fyren).

This commit is contained in:
David Anderson
2010-04-27 23:40:04 -07:00
parent 55205e631b
commit fc88cd3cb1
4 changed files with 64 additions and 8 deletions
+7 -2
View File
@@ -200,8 +200,8 @@ static void ReplicateConVar(ConVar *pConVar)
if (pPlayer && pPlayer->IsInGame() && !pPlayer->IsFakeClient())
{
INetChannel *netchan = static_cast<INetChannel *>(engine->GetPlayerNetInfo(i));
netchan->SendData(buffer);
if (INetChannel *netchan = static_cast<INetChannel *>(engine->GetPlayerNetInfo(i)))
netchan->SendData(buffer);
}
}
}
@@ -1319,6 +1319,11 @@ static cell_t SendConVarValue(IPluginContext *pContext, const cell_t *params)
}
INetChannel *netchan = static_cast<INetChannel *>(engine->GetPlayerNetInfo(params[1]));
if (netchan == NULL)
{
return 0;
}
netchan->SendData(buffer);
return 1;