summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/database.cc
diff options
context:
space:
mode:
authorAdam Borowski <kilobyte@angband.pl>2012-03-25 01:46:58 +0100
committerAdam Borowski <kilobyte@angband.pl>2012-03-25 12:51:20 +0200
commitf97044e2e9a86d8cf865aabe912a4f9e889908c2 (patch)
tree36feed9cfba59fffa45f8a6cf85c50348926c03d /crawl-ref/source/database.cc
parent9e79ca40f2895b1f7607b15246bf5a939ce8df2e (diff)
downloadcrawl-ref-f97044e2e9a86d8cf865aabe912a4f9e889908c2.tar.gz
crawl-ref-f97044e2e9a86d8cf865aabe912a4f9e889908c2.zip
Don't crash when a help topic is missing.
This doesn't solve the problem, merely a symptom.
Diffstat (limited to 'crawl-ref/source/database.cc')
-rw-r--r--crawl-ref/source/database.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/crawl-ref/source/database.cc b/crawl-ref/source/database.cc
index 085d68a548..c7befbb359 100644
--- a/crawl-ref/source/database.cc
+++ b/crawl-ref/source/database.cc
@@ -846,7 +846,10 @@ std::string getRandNameString(const std::string &itemtype,
std::string getHelpString(const std::string &topic)
{
- return _query_database(HelpDB, topic, false, true);
+ std::string help = _query_database(HelpDB, topic, false, true);
+ if (help.empty())
+ help = "Error! The help for \"" + topic + "\" is missing!";
+ return help;
}
/////////////////////////////////////////////////////////////////////////////