fixed nullptr exception when opening a stylesheet without a game twice, the solution is to re-load when loading/validating fails the first time

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1451 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2010-07-21 18:49:12 +00:00
parent 854998f204
commit 864cabb590
+1 -1
View File
@@ -556,11 +556,11 @@ void Packaged::open(const String& package, bool just_header) {
}
void Packaged::loadFully() {
if (fully_loaded) return;
fully_loaded = true;
Reader reader(openIn(typeName()), this, absoluteFilename() + _("/") + typeName());
try {
reader.handle_greedy(*this);
validate(reader.file_app_version);
fully_loaded = true; // only after loading and validating succeeded, be careful with recursion!
} catch (const ParseError& err) {
throw FileParseError(err.what(), absoluteFilename() + _("/") + typeName()); // more detailed message
}