From 014b830796ae3d738587f1ea39e6a1b0625a6d36 Mon Sep 17 00:00:00 2001 From: psychon Date: Mon, 6 Aug 2007 09:04:40 +0000 Subject: [PATCH] Fix sf.net bugs 1762981 and 1762977 and commit the patch from a comment in one of them. Now partyline doesn't segfault anymore if you remove a user which isn't there. I think NULL pointers don't like me :/. git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@818 726aef4b-f618-498e-8847-2d620e286838 --- modules/partyline.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/partyline.cpp b/modules/partyline.cpp index 3509284b..5a36180c 100644 --- a/modules/partyline.cpp +++ b/modules/partyline.cpp @@ -449,7 +449,12 @@ public: CUser* pUser = CZNC::Get().FindUser(sUser); CPartylineChannel* pChan = FindChannel(sChan); - if(!pChan || pChan->IsFixedChan(sUser)) { + if(pUser == NULL) { + PutModule("Unknown User '" + sUser + "'"); + return; + } + + if(!pChan || !pChan->IsFixedChan(sUser)) { PutModule(sUser + " is not in " + sChan + " or isnt fixed to it"); return; }