Index: Application/Ringtoets/src/Application.Ringtoets.Migration/RingtoetsProjectMigrator.cs =================================================================== diff -u -r0f45af06fa1ac31965e661cd8b2614d806bcc2ef -r1c60547d2fedbc14afb97de7874a0b3220cc5a05 --- Application/Ringtoets/src/Application.Ringtoets.Migration/RingtoetsProjectMigrator.cs (.../RingtoetsProjectMigrator.cs) (revision 0f45af06fa1ac31965e661cd8b2614d806bcc2ef) +++ Application/Ringtoets/src/Application.Ringtoets.Migration/RingtoetsProjectMigrator.cs (.../RingtoetsProjectMigrator.cs) (revision 1c60547d2fedbc14afb97de7874a0b3220cc5a05) @@ -147,13 +147,13 @@ private bool MigrateToTargetLocation(string sourceFilePath, string targetLocation) { - try + if (!CreateInitializedDatabaseLogFile()) { - if (!CreateInitializedDatabaseLogFile()) - { - return false; - } + return false; + } + try + { var versionedFile = new RingtoetsVersionedFile(sourceFilePath); fileMigrator.Migrate(versionedFile, currentDatabaseVersion, targetLocation); string message = string.Format(Resources.RingtoetsProjectMigrator_MigrateToTargetLocation_Outdated_projectfile_0_succesfully_updated_to_target_filepath_1_version_2_, @@ -216,7 +216,10 @@ { try { - File.Delete(migrationLogPath); + if (File.Exists(migrationLogPath)) + { + File.Delete(migrationLogPath); + } } catch (SystemException exception) when (exception is IOException || exception is UnauthorizedAccessException)