diff --git a/src/controllers/hid/hidiothread.cpp b/src/controllers/hid/hidiothread.cpp index 03f7535553b..95fdf41bcea 100644 --- a/src/controllers/hid/hidiothread.cpp +++ b/src/controllers/hid/hidiothread.cpp @@ -215,9 +215,13 @@ bool HidIoThread::sendNextCachedOutputReport() { // which only has the effect, that one additional lookup operation for unsent data will be executed. for (unsigned char i = 0; i < m_outputReports.size(); i++) { auto mapLock = lockMutex(&m_outputReportMapMutex); - m_outputReportIterator++; if (m_outputReportIterator == m_outputReports.end()) { m_outputReportIterator = m_outputReports.begin(); + } else { + m_outputReportIterator++; + if (m_outputReportIterator == m_outputReports.end()) { + m_outputReportIterator = m_outputReports.begin(); + } } mapLock.unlock();