summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/configreader.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/configreader.cpp b/src/configreader.cpp
index 0318dd602..782a80080 100644
--- a/src/configreader.cpp
+++ b/src/configreader.cpp
@@ -80,11 +80,16 @@ static void ReadXLine(ServerConfig* conf, const std::string& tag, const std::str
for(ConfigIter i = tags.first; i != tags.second; ++i)
{
ConfigTag* ctag = i->second;
- std::string mask;
- if (!ctag->readString(key, mask))
- throw CoreException("<"+tag+":"+key+"> missing at " + ctag->getTagLocation());
- std::string reason = ctag->getString("reason", "<Config>");
- XLine* xl = make->Generate(ServerInstance->Time(), 0, "<Config>", reason, mask);
+
+ const std::string mask = ctag->getString(key);
+ if (mask.empty())
+ throw CoreException("<" + tag + ":" + key + "> missing at " + ctag->getTagLocation());
+
+ const std::string reason = ctag->getString("reason");
+ if (reason.empty())
+ throw CoreException("<" + tag + ":reason> missing at " + ctag->getTagLocation());
+
+ XLine* xl = make->Generate(ServerInstance->Time(), 0, ServerInstance->Config->ServerName, reason, mask);
xl->from_config = true;
configlines.insert(xl->Displayable());
if (!ServerInstance->XLines->AddLine(xl, NULL))