diff --git a/modules/juce_audio_devices/native/juce_win32_Midi.cpp b/modules/juce_audio_devices/native/juce_win32_Midi.cpp index cbb7fd4162..60f60099d2 100644 --- a/modules/juce_audio_devices/native/juce_win32_Midi.cpp +++ b/modules/juce_audio_devices/native/juce_win32_Midi.cpp @@ -388,7 +388,7 @@ private: { auto* activeHandle = parent.activeOutputHandles.getUnchecked (i); - if (han->deviceId == deviceId) + if (activeHandle->deviceId == deviceId) { activeHandle->refCount++; han = activeHandle;