mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-11-22 18:17:56 +00:00
Merge pull request #3782 from anders-dc/fix/null-serial-on-boot-overwrite
Fix null _serial dereference when contacts are overwritten during boot
This commit is contained in:
1 file changed
+2
-2
@@ -341,7 +341,7 @@ uint8_t MyMesh::getAutoAddMaxHops() const {
|
||||
|
||||
void MyMesh::onContactOverwrite(const uint8_t* pub_key) {
|
||||
_store->deleteBlobByKey(pub_key, PUB_KEY_SIZE); // delete from storage
|
||||
if (_serial->isConnected()) {
|
||||
if (_serial && _serial->isConnected()) {
|
||||
out_frame[0] = PUSH_CODE_CONTACT_DELETED;
|
||||
memcpy(&out_frame[1], pub_key, PUB_KEY_SIZE);
|
||||
_serial->writeFrame(out_frame, 1 + PUB_KEY_SIZE);
|
||||
@@ -349,7 +349,7 @@ void MyMesh::onContactOverwrite(const uint8_t* pub_key) {
|
||||
}
|
||||
|
||||
void MyMesh::onContactsFull() {
|
||||
if (_serial->isConnected()) {
|
||||
if (_serial && _serial->isConnected()) {
|
||||
out_frame[0] = PUSH_CODE_CONTACTS_FULL;
|
||||
_serial->writeFrame(out_frame, 1);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user