]> jfr.im git - irc/UndernetIRC/gnuworld.git/commitdiff
mod.cservice: some set commands cause core with non-existent network chan
authorEmpus <redacted>
Thu, 31 Jan 2019 13:56:06 +0000 (05:56 -0800)
committerEmpus <redacted>
Thu, 31 Jan 2019 13:56:06 +0000 (05:56 -0800)
mod.cservice/SETCommand.cc

index 04c1bb9935d3e7c726f1132a85389176c9b280f5..a96101bff1d1cb3cbcc1be4e84c87d37233fccc7 100644 (file)
@@ -1180,19 +1180,25 @@ else
                                option.c_str(), theChan->getName().c_str(), sqlChannel::getFloodLevelName(theChan->getFloodproLevel()).c_str());
                if (theChan->getFloodproLevel() > prevFN)
                {
-                       bot->NoticeChannelOps(tmpChan, "Increased %s punishment level on %s to %s by %s",
+                       if (tmpChan)
+                       {
+                               bot->NoticeChannelOps(tmpChan, "Increased %s punishment level on %s to %s by %s",
                                option.c_str(),
                                theChan->getName().c_str(),
                                value.c_str(),
                                theUser->getUserName().c_str());
+                       }
                }
                else if (theChan->getFloodproLevel() < prevFN)
                {
-                       bot->NoticeChannelOps(tmpChan, "Decreased %s punishment level on %s to %s by %s",
-                               option.c_str(),
-                               theChan->getName().c_str(),
-                               value.c_str(),
-                               theUser->getUserName().c_str());
+                       if (tmpChan)
+                       {
+                               bot->NoticeChannelOps(tmpChan, "Decreased %s punishment level on %s to %s by %s",
+                                       option.c_str(),
+                                       theChan->getName().c_str(),
+                                       value.c_str(),
+                                       theUser->getUserName().c_str());
+                       }
                }
            return true;
        }
@@ -1235,19 +1241,25 @@ else
                        option.c_str(), theChan->getName().c_str(),     value.c_str());
                if (theChan->getFloodproLevel() > prevFN)
                {
-                       bot->NoticeChannelOps(tmpChan, "Increased %s punishment level on %s to %s by %s",
-                               option.c_str(),
-                               theChan->getName().c_str(),
-                               value.c_str(),
-                               theUser->getUserName().c_str());
+                       if (tmpChan)
+                       {
+                               bot->NoticeChannelOps(tmpChan, "Increased %s punishment level on %s to %s by %s",
+                                       option.c_str(),
+                                       theChan->getName().c_str(),
+                                       value.c_str(),
+                                       theUser->getUserName().c_str());
+                       }
                }
                else if (theChan->getFloodproLevel() < prevFN)
                {
-                       bot->NoticeChannelOps(tmpChan, "Decreased %s punishment level on %s to %s by %s",
-                               option.c_str(),
-                               theChan->getName().c_str(),
-                               value.c_str(),
-                               theUser->getUserName().c_str());
+                       if (tmpChan)
+                       {
+                               bot->NoticeChannelOps(tmpChan, "Decreased %s punishment level on %s to %s by %s",
+                                       option.c_str(),
+                                       theChan->getName().c_str(),
+                                       value.c_str(),
+                                       theUser->getUserName().c_str());
+                       }
                }
 
            return true;