diff --git a/src/miscellaneous/Bakabase.Migrations/V190/V190Migrator.cs b/src/miscellaneous/Bakabase.Migrations/V190/V190Migrator.cs index caa3a05f..935f8a6c 100644 --- a/src/miscellaneous/Bakabase.Migrations/V190/V190Migrator.cs +++ b/src/miscellaneous/Bakabase.Migrations/V190/V190Migrator.cs @@ -339,6 +339,7 @@ private async Task MigrateCustomProperties() var newResourceCoverDir = Path.Combine(newCoverRootDir, resourceId.ToString()); var subFiles = Directory.GetFiles(sd, "*", SearchOption.AllDirectories); + Directory.CreateDirectory(newResourceCoverDir); try { foreach (var sf in subFiles) @@ -356,11 +357,14 @@ private async Task MigrateCustomProperties() $"Failed to migrate cover files for resource {resourceId}."); } - var covers = Directory.GetFiles(newResourceCoverDir); - if (covers.Any()) + if (Directory.Exists(newResourceCoverDir)) { - resourceBizValueMap[resourceId] = - new ListStringValueBuilder(covers.ToList()).Value; + var covers = Directory.GetFiles(newResourceCoverDir); + if (covers.Any()) + { + resourceBizValueMap[resourceId] = + new ListStringValueBuilder(covers.ToList()).Value; + } } } }