Crash fix - throw if file can't be opened
This commit is contained in:
parent
701366bf86
commit
eaca77c2de
1 changed files with 5 additions and 0 deletions
|
@ -102,6 +102,11 @@ namespace dkh {
|
|||
throw std::runtime_error("Invalid data: can't parse file");
|
||||
}
|
||||
|
||||
if (grammar.lengths.empty()) {
|
||||
m_mapSize.x() = m_mapSize.y() = 0;
|
||||
throw std::runtime_error("Invalid data: can't guess map size");
|
||||
}
|
||||
|
||||
//Only look at the front. Besides a bug in spirit makes the other counts
|
||||
//invalid, see
|
||||
//http://boost.2283326.n4.nabble.com/Possible-bug-in-line-pos-iterator-td4636592.html
|
||||
|
|
Loading…
Add table
Reference in a new issue