diff options
-rw-r--r-- | src/config.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/config.cpp b/src/config.cpp index 432e1001f..bd9bebe5c 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -943,5 +943,10 @@ void Conf::LoadConf(File &file) if (!itemname.empty() || !wordbuffer.empty()) throw ConfigException("Unexpected garbage at end of file: " + file.GetName()); if (!block_stack.empty()) - throw ConfigException("Unterminated block at end of file: " + file.GetName() + ". Block was opened on line " + stringify(block_stack.top()->linenum)); + { + if (block_stack.top()) + throw ConfigException("Unterminated block at end of file: " + file.GetName() + ". Block was opened on line " + stringify(block_stack.top()->linenum)); + else + throw ConfigException("Unterminated commented block at end of file: " + file.GetName()); + } } |