From 2fcf34cdc43a7ef546887448f49c4cfa084ba935 Mon Sep 17 00:00:00 2001 From: Vitaly Novichkov Date: Thu, 21 Jun 2018 08:04:31 +0300 Subject: MIDI Sequencer: Small clean-up --- src/adlmidi.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/adlmidi.cpp') diff --git a/src/adlmidi.cpp b/src/adlmidi.cpp index 69755d3..efd716c 100644 --- a/src/adlmidi.cpp +++ b/src/adlmidi.cpp @@ -517,7 +517,10 @@ ADLMIDI_EXPORT int adl_switchEmulator(struct ADL_MIDIPlayer *device, int emulato if(device) { MIDIplay *play = reinterpret_cast(device->adl_midiPlayer); - if(play && (emulator >= 0) && (emulator < ADLMIDI_EMU_end)) + assert(play); + if(!play) + return -1; + if((emulator >= 0) && (emulator < ADLMIDI_EMU_end)) { play->m_setup.emulator = emulator; adl_reset(device); -- cgit v1.2.3