summaryrefslogtreecommitdiffstats
path: root/src/commands/cmd_rules.cpp
diff options
context:
space:
mode:
authorGravatar Jackmcbarn2010-12-01 15:25:35 -0500
committerGravatar Jackmcbarn2010-12-01 15:25:35 -0500
commit530fcdcc98ca3f5d4e0243afadb515fe21955dcd (patch)
treeef8a61c1a71e538afefa2bb72899a97fac579e41 /src/commands/cmd_rules.cpp
parentRemove unneeded operator (diff)
downloadinspircd++-530fcdcc98ca3f5d4e0243afadb515fe21955dcd.tar.gz
inspircd++-530fcdcc98ca3f5d4e0243afadb515fe21955dcd.tar.bz2
inspircd++-530fcdcc98ca3f5d4e0243afadb515fe21955dcd.zip
Explain why a null pointer is safe here
Diffstat (limited to 'src/commands/cmd_rules.cpp')
-rw-r--r--src/commands/cmd_rules.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/commands/cmd_rules.cpp b/src/commands/cmd_rules.cpp
index 3958a1d0e..21d5a3293 100644
--- a/src/commands/cmd_rules.cpp
+++ b/src/commands/cmd_rules.cpp
@@ -47,7 +47,11 @@ CmdResult CommandRules::Handle (const std::vector<std::string>& parameters, User
ConfigTag* tag = NULL;
if (IS_LOCAL(user))
tag = IS_LOCAL(user)->MyClass->config;
+
+ // Although tag could be null here, ConfigTag::getString can be called on a null object safely.
+ // cppcheck-suppress nullPointer
std::string rules_name = tag->getString("rules", "rules");
+
ConfigFileCache::iterator rules = ServerInstance->Config->Files.find(rules_name);
if (rules == ServerInstance->Config->Files.end())
{