diff --git a/src/BUTR.CrashReportServer/Services/DatabaseMigrator.cs b/src/BUTR.CrashReportServer/Services/DatabaseMigrator.cs index 87bf262..8dc3413 100644 --- a/src/BUTR.CrashReportServer/Services/DatabaseMigrator.cs +++ b/src/BUTR.CrashReportServer/Services/DatabaseMigrator.cs @@ -69,7 +69,16 @@ await Parallel.ForEachAsync(Enumerable.Range(0, 4), options, async (_, ct2) => decompressed.Seek(0, SeekOrigin.Begin); decompressed.Seek(0, SeekOrigin.Begin); - var (valid, id, version, json) = await CrashReportRawParser.TryReadCrashReportDataAsync(PipeReader.Create(decompressed)); + var valid = false; + var version = 0; + try + { + var (valid2, id, version2, json) = await CrashReportRawParser.TryReadCrashReportDataAsync(PipeReader.Create(decompressed)); + valid = valid2; + version = version2; + } + catch (Exception) { } + if (valid) { sb.AppendLine($""" @@ -85,6 +94,8 @@ DELETE FROM id_entity WHERE file_id = '{entity.Id.FileId}'; DELETE FROM file_entity WHERE file_id = '{entity.Id.FileId}'; + DELETE FROM json_entity + WHERE file_id = '{entity.Id.FileId}'; """); } }