Skip migrations if DocumentVersion missing

- Disable old migrations
 -  Issue MatterHackers/MCCentral#252
This commit is contained in:
John Lewin 2016-08-04 08:57:14 -07:00
parent c4095efb68
commit e29bf11631
2 changed files with 3 additions and 1 deletions

View file

@ -266,7 +266,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
}
}
int documentVersion = jObject?.GetValue("DocumentVersion")?.Value<int>() ?? 0;
int documentVersion = jObject?.GetValue("DocumentVersion")?.Value<int>() ?? PrinterSettings.LatestVersion;
if (documentVersion < PrinterSettings.LatestVersion)
{
printerProfilePath = ProfileMigrations.MigrateDocument(printerProfilePath, documentVersion);

View file

@ -44,6 +44,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
{
var jObject = JObject.Parse(File.ReadAllText(filePath));
/*
if (fromVersion < 201605131)
{
var materialLayers = jObject["MaterialLayers"] as JObject;
@ -94,6 +95,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
File.Delete(filePath);
filePath = Path.Combine(Path.GetDirectoryName(filePath), printerID + ProfileManager.ProfileExtension);
}
*/
if (fromVersion < 201606081)
{