Fix null pointer dereference in radio chip region check (#8613)

This commit is contained in:
Andrik45719
2025-11-11 18:00:08 +02:00
committed by GitHub
parent 4118e1c0f6
commit 7212fb9caa

View File

@@ -1401,7 +1401,7 @@ void setup()
#endif
// check if the radio chip matches the selected region
if ((config.lora.region == meshtastic_Config_LoRaConfig_RegionCode_LORA_24) && (!rIf->wideLora())) {
if ((config.lora.region == meshtastic_Config_LoRaConfig_RegionCode_LORA_24) && rIf && (!rIf->wideLora())) {
LOG_WARN("LoRa chip does not support 2.4GHz. Revert to unset");
config.lora.region = meshtastic_Config_LoRaConfig_RegionCode_UNSET;
nodeDB->saveToDisk(SEGMENT_CONFIG);