Fixed unhandled exception when admin_jid is not set

This commit is contained in:
HanzZ 2012-04-30 14:13:56 +02:00
parent e1d14b6951
commit ce67e1623f
2 changed files with 7 additions and 3 deletions

View file

@ -28,13 +28,13 @@
#include <boost/bind.hpp>
#include <boost/signal.hpp>
#define CONFIG_HAS_KEY(PTR, KEY) (*PTR).hasKey(KEY)
#define CONFIG_STRING(PTR, KEY) (*PTR)[KEY].as<std::string>()
#define CONFIG_INT(PTR, KEY) (*PTR)[KEY].as<int>()
#define CONFIG_BOOL(PTR, KEY) (*PTR)[KEY].as<bool>()
#define CONFIG_LIST(PTR, KEY) (*PTR)[KEY].as<std::list<std::string> >()
#define CONFIG_VECTOR(PTR, KEY) (*PTR)[KEY].as<std::vector<std::string> >()
#define CONFIG_HAS_KEY(PTR, KEY) (*PTR).hasKey(KEY)
#define CONFIG_VECTOR(PTR, KEY) ((*PTR).hasKey(KEY) ? (*PTR)[KEY].as<std::vector<std::string> >() : std::vector<std::string>())
namespace Transport {

View file

@ -68,6 +68,10 @@ class ManagerConfig {
return m_variables[key];
}
bool hasKey(const std::string &key) {
return m_variables.find(key) != m_variables.end();
}
/// Returns path to config file from which data were loaded.
const std::string &getManagerConfigFile() { return m_file; }