summaryrefslogtreecommitdiff
path: root/noncore/net/opieirc/ircsession.cpp
Unidiff
Diffstat (limited to 'noncore/net/opieirc/ircsession.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/opieirc/ircsession.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/noncore/net/opieirc/ircsession.cpp b/noncore/net/opieirc/ircsession.cpp
index c8d7869..d87ff80 100644
--- a/noncore/net/opieirc/ircsession.cpp
+++ b/noncore/net/opieirc/ircsession.cpp
@@ -140,9 +140,11 @@ void IRCSession::updateNickname(const QString &oldNickname, const QString &newNi
140 QListIterator<IRCChannel> it(channels); 140 QListIterator<IRCChannel> it(channels);
141 for (;it.current(); ++it) { 141 for (;it.current(); ++it) {
142 IRCChannelPerson *chanperson = it.current()->getPerson(oldNickname); 142 IRCChannelPerson *chanperson = it.current()->getPerson(oldNickname);
143 it.current()->removePerson(chanperson); 143 if (chanperson) {
144 chanperson->setNick(newNickname); 144 it.current()->removePerson(chanperson);
145 it.current()->addPerson(chanperson); 145 chanperson->setNick(newNickname);
146 it.current()->addPerson(chanperson);
147 }
146 } 148 }
147 149
148 emit updateChannels(); 150 emit updateChannels();