Skip to content

Commit 9445593

Browse files
committed
Merge branch 'pr/161' into 1.4.3
2 parents 6621c5a + 5b653df commit 9445593

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

Writer/MzMlSpectrumWriter.cs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -589,8 +589,16 @@ public override void Write(IRawDataPlus rawFile, int firstScanNumber, int lastSc
589589

590590
if (_doIndexing)
591591
{
592-
cryptoStream.Flush();
593-
cryptoStream.Close();
592+
try
593+
{
594+
cryptoStream.Flush();
595+
cryptoStream.Close();
596+
}
597+
catch (System.ObjectDisposedException e)
598+
{
599+
// Cannot access a closed file. CryptoStream was already closed when closing _writer
600+
Log.Warn($"Warning: {e.Message}");
601+
}
594602
}
595603
}
596604

0 commit comments

Comments
 (0)