Merge pull request #1246 from jlewin/master

Skip migrations if DocumentVersion missing
This commit is contained in:
johnlewin 2016-08-04 09:06:06 -07:00 committed by GitHub
commit 79d3686bca
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)
{