check if instrument window is disposed before playing (#5655)

This commit is contained in:
Leon Friedrich 2021-12-02 23:51:30 +13:00 committed by GitHub
parent b36bb8afa8
commit 7b59a205b8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -79,6 +79,10 @@ namespace Content.Client.Instruments.UI
var filters = new FileDialogFilters(new FileDialogFilters.Group("mid", "midi"));
await using var file = await _fileDialogManager.OpenFile(filters);
// did the instrument menu get closed while waiting for the user to select a file?
if (Disposed)
return;
// The following checks are only in place to prevent players from playing MIDI songs locally.
// There are equivalents for these checks on the server.