Skip to content

Commit

Permalink
Fix known_only panic by short circuiting for NULL before checking has…
Browse files Browse the repository at this point in the history
…_user (meshtastic#3352)
  • Loading branch information
thebentern authored Mar 8, 2024
1 parent 585805c commit 7da1153
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/mesh/Router.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ bool perhapsDecode(meshtastic_MeshPacket *p)
return false;

if (config.device.rebroadcast_mode == meshtastic_Config_DeviceConfig_RebroadcastMode_KNOWN_ONLY &&
!nodeDB.getMeshNode(p->from)->has_user) {
(nodeDB.getMeshNode(p->from) == NULL || !nodeDB.getMeshNode(p->from)->has_user)) {
LOG_DEBUG("Node 0x%x not in NodeDB. Rebroadcast mode KNOWN_ONLY will ignore packet\n", p->from);
return false;
}
Expand Down

0 comments on commit 7da1153

Please sign in to comment.