diff options
| author | 2010-12-01 15:25:35 -0500 | |
|---|---|---|
| committer | 2010-12-01 15:25:35 -0500 | |
| commit | 530fcdcc98ca3f5d4e0243afadb515fe21955dcd (patch) | |
| tree | ef8a61c1a71e538afefa2bb72899a97fac579e41 /src/commands/cmd_rules.cpp | |
| parent | Remove unneeded operator (diff) | |
| download | inspircd++-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.cpp | 4 |
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()) { |
