summaryrefslogtreecommitdiff
path: root/noncore/net/opieirc/ircsession.cpp
Side-by-side diff
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
QListIterator<IRCChannel> it(channels);
for (;it.current(); ++it) {
IRCChannelPerson *chanperson = it.current()->getPerson(oldNickname);
- it.current()->removePerson(chanperson);
- chanperson->setNick(newNickname);
- it.current()->addPerson(chanperson);
+ if (chanperson) {
+ it.current()->removePerson(chanperson);
+ chanperson->setNick(newNickname);
+ it.current()->addPerson(chanperson);
+ }
}
emit updateChannels();