summaryrefslogtreecommitdiff
path: root/include/config.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/config.h')
-rw-r--r--include/config.h15
1 files changed, 7 insertions, 8 deletions
diff --git a/include/config.h b/include/config.h
index 019564680..b132c5d2d 100644
--- a/include/config.h
+++ b/include/config.h
@@ -51,14 +51,13 @@ namespace Configuration
template<typename T> T Get(const Anope::string &tag, const Anope::string &def) const
{
const Anope::string &value = this->Get<const Anope::string>(tag, def);
- try
- {
- return convertTo<T>(value);
- }
- catch (const ConvertException &)
- {
- return T();
- }
+ if (!value.empty())
+ try
+ {
+ return convertTo<T>(value);
+ }
+ catch (const ConvertException &) { }
+ return T();
}
bool Set(const Anope::string &tag, const Anope::string &value);