mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
Fix crash on missing parameters with IRC /kick command (#3382)
This commit is contained in:
parent
3fcb6346f5
commit
568f65213d
|
@ -62,6 +62,7 @@
|
|||
- Bugfix: Fixed the first usercard being broken in `/mods` and `/vips` (#3349)
|
||||
- Bugfix: Fixed Chatterino attempting to send empty messages (#3355)
|
||||
- Bugfix: Fixed IRC highlights not triggering sounds or alerts properly. (#3368)
|
||||
- Bugfix: Fixed IRC /kick command crashing if parameters were malformed. (#3382)
|
||||
- Dev: Add GitHub action to test builds without precompiled headers enabled. (#3327)
|
||||
- Dev: Renamed CMake's build option `USE_SYSTEM_QT5KEYCHAIN` to `USE_SYSTEM_QTKEYCHAIN`. (#3103)
|
||||
- Dev: Add benchmarks that can be compiled with the `BUILD_BENCHMARKS` CMake flag. Off by default. (#3038)
|
||||
|
|
|
@ -55,11 +55,24 @@ Outcome invokeIrcCommand(const QString &commandName, const QString &allParams,
|
|||
}
|
||||
else if (cmd == "kick")
|
||||
{
|
||||
if (paramsAfter(1).isEmpty())
|
||||
sendRaw("KICK " + params[0] + " " + params[1]);
|
||||
if (params.size() < 2)
|
||||
{
|
||||
channel.addMessage(
|
||||
makeSystemMessage("Usage: /kick <channel> <client> [message]"));
|
||||
return Failure;
|
||||
}
|
||||
const auto &channelParam = params[0];
|
||||
const auto &clientParam = params[1];
|
||||
const auto &messageParam = paramsAfter(1);
|
||||
if (messageParam.isEmpty())
|
||||
{
|
||||
sendRaw("KICK " + channelParam + " " + clientParam);
|
||||
}
|
||||
else
|
||||
sendRaw("KICK " + params[0] + " " + params[1] + " :" +
|
||||
paramsAfter(1));
|
||||
{
|
||||
sendRaw("KICK " + channelParam + " " + clientParam + " :" +
|
||||
messageParam);
|
||||
}
|
||||
}
|
||||
else if (cmd == "wallops")
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue