mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 13:06:59 -04:00
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:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user