From: Manuel Nickschas Date: Tue, 5 Oct 2010 16:17:47 +0000 (+0200) Subject: Make sure IrcEventTopic always has two params X-Git-Tag: 0.8-beta1~102 X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=commitdiff_plain;h=96cd8441f9ab217b1d3c2ba0f2899ef64ca781e4;hp=d60c5028b49a95d3c27c35b2ea1d74cdd7bb0e46 Make sure IrcEventTopic always has two params In case of an empty topic, adding a null string in the event saves us from specialcasing this in a few places. --- diff --git a/src/core/ircparser.cpp b/src/core/ircparser.cpp index 75ac2c99..34e693d6 100644 --- a/src/core/ircparser.cpp +++ b/src/core/ircparser.cpp @@ -242,10 +242,10 @@ void IrcParser::processNetworkIncoming(NetworkDataEvent *e) { break; case EventManager::IrcEventTopic: - if(params.count() >= 2) { + if(params.count() >= 1) { QString channel = net->serverDecode(params.at(0)); decParams << channel; - decParams << net->channelDecode(channel, decrypt(net, channel, params.at(1), true)); + decParams << (params.count() >= 2? net->channelDecode(channel, decrypt(net, channel, params.at(1), true)) : QString()); } break;