m_svshold Fix crash when called with 2 params, only triggerable by u-lines

This commit is contained in:
attilamolnar 2012-12-05 21:13:16 +01:00
parent a969c1e440
commit 391ec2c499

View File

@ -123,6 +123,9 @@ class CommandSvshold : public Command
} }
else else
{ {
if (parameters.size() < 3)
return CMD_FAILURE;
// Adding - XXX todo make this respect <insane> tag perhaps.. // Adding - XXX todo make this respect <insane> tag perhaps..
long duration = ServerInstance->Duration(parameters[1]); long duration = ServerInstance->Duration(parameters[1]);
SVSHold* r = new SVSHold(ServerInstance->Time(), duration, user->nick.c_str(), parameters[2].c_str(), parameters[0].c_str()); SVSHold* r = new SVSHold(ServerInstance->Time(), duration, user->nick.c_str(), parameters[2].c_str(), parameters[0].c_str());