summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--crawl-ref/source/mapdef.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/crawl-ref/source/mapdef.cc b/crawl-ref/source/mapdef.cc
index dc3e9bf384..a8044f1952 100644
--- a/crawl-ref/source/mapdef.cc
+++ b/crawl-ref/source/mapdef.cc
@@ -112,8 +112,13 @@ static std::string split_key_item(const std::string &s,
std::string substitute = trimmed_string(s.substr(sep + 1));
if (what_to_subst.length() != 1)
- return make_stringf("selector '%s' must be exactly one character",
- what_to_subst.c_str());
+ return make_stringf(
+ "selector '%s' must be exactly one character in '%s'",
+ what_to_subst.c_str(), s.c_str());
+
+ if (substitute.empty())
+ return make_stringf("no substitute defined in '%s'",
+ s.c_str());
*key = what_to_subst[0];
*arg = substitute;