naudio / NAudio

Audio and MIDI library for .NET
MIT License
5.5k stars 1.1k forks source link

`AcmStream.Convert` throws `NullReferenceException` when disposed #1108

Closed lostmsu closed 7 months ago

lostmsu commented 8 months ago

Should throw something meaningful like ObjectDisposedException.

The issue happens because streamHeader field gets nulled in Dispose.

lostmsu commented 7 months ago

@markheath nitpick, but the first parameter to ObjectDisposedException constructor is objectName (e.g. nameof(AcmStream)), not message, and it should not be localized. Might be useful when figuring out between multiple disposed objects.