From 3f4166b0f72c69474f408a976bde62608929a347 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Fri, 8 Mar 2024 07:26:45 -0600 Subject: [PATCH] Fix known_only panic by short circuiting for NULL before checking has_user --- src/mesh/Router.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mesh/Router.cpp b/src/mesh/Router.cpp index 7657d2268d..7c739b8f28 100644 --- a/src/mesh/Router.cpp +++ b/src/mesh/Router.cpp @@ -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; }