From 4e12141e3abfc9b692ea13699c8f4e80573ac14f Mon Sep 17 00:00:00 2001 From: Andrew Belt Date: Fri, 18 May 2018 18:29:33 -0400 Subject: [PATCH] Fix blank MIDI driver bug --- dep/nanosvg | 2 +- src/midi.cpp | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dep/nanosvg b/dep/nanosvg index 06c1f0f3..9a74da4d 160000 --- a/dep/nanosvg +++ b/dep/nanosvg @@ -1 +1 @@ -Subproject commit 06c1f0f3bb041d69a73bb74067d063a700215b0e +Subproject commit 9a74da4db5ac74083e444010d75114658581b9c7 diff --git a/src/midi.cpp b/src/midi.cpp index a3d27acd..ed4332e9 100644 --- a/src/midi.cpp +++ b/src/midi.cpp @@ -55,11 +55,11 @@ std::vector MidiIO::getDriverIds() { } std::string MidiIO::getDriverName(int driverId) { - MidiDriver *driver = drivers[driverId]; - if (driver) { - return driver->getName(); - } - return ""; + auto it = drivers.find(driverId); + if (it == drivers.end()) + return ""; + + return it->second->getName(); } void MidiIO::setDriverId(int driverId) {