From 6935ce2956fed99d5484da90e614b7126e5275d3 Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Wed, 8 Oct 2014 16:34:37 +0100 Subject: Avoid calling methods on NULL pointers wherever possible. The trick we use to allow this is undefined behaviour and is not liked by LLVM. We should stop using it but it has the potential to break to many things for a minor release. --- src/commands/cmd_motd.cpp | 2 +- src/commands/cmd_rules.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/commands') diff --git a/src/commands/cmd_motd.cpp b/src/commands/cmd_motd.cpp index 8e227723e..869a9c353 100644 --- a/src/commands/cmd_motd.cpp +++ b/src/commands/cmd_motd.cpp @@ -53,7 +53,7 @@ CmdResult CommandMotd::Handle (const std::vector& parameters, User if (parameters.size() > 0 && parameters[0] != ServerInstance->Config->ServerName) return CMD_SUCCESS; - ConfigTag* tag = NULL; + ConfigTag* tag = ServerInstance->Config->EmptyTag; if (IS_LOCAL(user)) tag = user->GetClass()->config; std::string motd_name = tag->getString("motd", "motd"); diff --git a/src/commands/cmd_rules.cpp b/src/commands/cmd_rules.cpp index 5d41aa4b8..17de9f3f2 100644 --- a/src/commands/cmd_rules.cpp +++ b/src/commands/cmd_rules.cpp @@ -51,7 +51,7 @@ CmdResult CommandRules::Handle (const std::vector& parameters, User if (parameters.size() > 0 && parameters[0] != ServerInstance->Config->ServerName) return CMD_SUCCESS; - ConfigTag* tag = NULL; + ConfigTag* tag = ServerInstance->Config->EmptyTag; if (IS_LOCAL(user)) tag = user->GetClass()->config; std::string rules_name = tag->getString("rules", "rules"); -- cgit v1.2.3