Fix #354, make jar mods and patch files in general more resilient.
This commit is contained in:
parent
ff06489fed
commit
40c238442f
2 changed files with 12 additions and 3 deletions
|
@ -111,8 +111,14 @@ void VersionBuilder::readInstancePatches()
|
|||
continue;
|
||||
// parse the file
|
||||
QString filename = patches.absoluteFilePath(id + ".json");
|
||||
QFileInfo finfo(filename);
|
||||
if(!finfo.exists())
|
||||
{
|
||||
QLOG_INFO() << "Patch file " << filename << " was deleted by external means...";
|
||||
continue;
|
||||
}
|
||||
QLOG_INFO() << "Reading" << filename << "by user order";
|
||||
auto file = parseJsonFile(QFileInfo(filename), false);
|
||||
auto file = parseJsonFile(finfo, false);
|
||||
// sanity check. prevent tampering with files.
|
||||
if (file->fileId != id)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue