Crash fix - throw if file can't be opened

This commit is contained in:
King_DuckZ 2015-01-08 12:44:36 +01:00
parent 701366bf86
commit eaca77c2de

View file

@ -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