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:
Liam Cottle authored and GitHub committed 2026-11-09 01:02:31 +13:00
commit 4deb88dfe8
1 file changed
+2 -2
+2 -2
View File
@@ -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);
}