mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-11-21 22:47:05 +00:00
fix(companion): guard null _serial in contact overwrite and full callbacks
This commit is contained in:
1 parent
056d264c63
commit
9fd02ff3bc
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