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,7 +256,9 @@ bool NimBLERemoteService::retrieveCharacteristics(const NimBLEUUID *uuid_filter)
}
}
m_characteristicVector.back()->m_endHandle = getEndHandle();
if (m_characteristicVector.size() > 0) {
m_characteristicVector.back()->m_endHandle = getEndHandle();
}
}
NIMBLE_LOGD(LOG_TAG, "<< retrieveCharacteristics()");