Prevent crash when characteristic vector is empty.

This commit is contained in:
h2zero 2022-04-02 14:22:23 -06:00
parent a1428e63a6
commit 58787b516b

View file

@ -256,8 +256,10 @@ bool NimBLERemoteService::retrieveCharacteristics(const NimBLEUUID *uuid_filter)
} }
} }
if (m_characteristicVector.size() > 0) {
m_characteristicVector.back()->m_endHandle = getEndHandle(); m_characteristicVector.back()->m_endHandle = getEndHandle();
} }
}
NIMBLE_LOGD(LOG_TAG, "<< retrieveCharacteristics()"); NIMBLE_LOGD(LOG_TAG, "<< retrieveCharacteristics()");
return true; return true;