diff options
author | Adam Borowski <kilobyte@angband.pl> | 2012-03-25 01:46:58 +0100 |
---|---|---|
committer | Adam Borowski <kilobyte@angband.pl> | 2012-03-25 12:51:20 +0200 |
commit | f97044e2e9a86d8cf865aabe912a4f9e889908c2 (patch) | |
tree | 36feed9cfba59fffa45f8a6cf85c50348926c03d /crawl-ref/source/database.cc | |
parent | 9e79ca40f2895b1f7607b15246bf5a939ce8df2e (diff) | |
download | crawl-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.cc | 5 |
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; } ///////////////////////////////////////////////////////////////////////////// |