From b9fbf3621c2a3ee18dd9c575d086fc16905f4793 Mon Sep 17 00:00:00 2001 From: brain Date: Mon, 10 Jul 2006 18:13:07 +0000 Subject: Properly set the resulting pointer to NULL when the object isnt found git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4292 e03df62e-2008-0410-955e-edbf42e46eb7 --- include/base.h | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/include/base.h b/include/base.h index ac5fec63f..01b0e9ae1 100644 --- a/include/base.h +++ b/include/base.h @@ -5,7 +5,7 @@ * InspIRCd is copyright (C) 2002-2006 ChatSpike-Dev. * E-mail: * - * + * * * Written by Craig Edwards, Craig McLure, and others. * This program is free but copyrighted software; see @@ -96,15 +96,16 @@ public: */ template bool GetExt(const std::string &key, T* &p) { - ExtensibleStore::iterator iter = this->Extension_Items.find(key); - if(iter != this->Extension_Items.end()) - { + ExtensibleStore::iterator iter = this->Extension_Items.find(key); + if(iter != this->Extension_Items.end()) + { p = (T*)iter->second; - return true; - } - else - { - return false; + return true; + } + else + { + p = NULL; + return false; } } //char* GetExt(const std::string &key); -- cgit v1.2.3