Use find() to check element in map to avoid unknow element been insert
into map causing null point dereference.
Bug:
121310341
Test: Manual connect/disconnect headset
Change-Id: If127086ec4beb9b735ef3c72456e8e2209826b57
void ConnectionHandler::MessageCb(uint8_t handle, uint8_t label, uint8_t opcode,
tAVRC_MSG* p_msg) {
- if (device_map_[handle] == nullptr) {
+ if (device_map_.find(handle) == device_map_.end()) {
LOG(ERROR) << "Message received for unconnected device: handle="
<< loghex(handle);
return;