Skip to content

Commit aec0805

Browse files
committed
Trying another guard approach
1 parent 7800dc3 commit aec0805

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

src/mesh/HardwareRNG.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,11 @@ bool mixWithLoRaEntropy(uint8_t *buffer, size_t length)
4848
// and return false so callers know no extra mixing occurred.
4949
RadioLibInterface *radio = RadioLibInterface::instance;
5050
if (!radio) {
51-
#ifndef PIO_UNIT_TESTING
52-
LOG_ERROR("No radio instance available to provide entropy");
53-
#endif
51+
// This path can run during portduinoSetup() before the console is initialized,
52+
// both for unit-test binaries and the simulator's meshtasticd; LOG_* dereferences `console`.
53+
if (console) {
54+
LOG_ERROR("No radio instance available to provide entropy");
55+
}
5456
return false;
5557
}
5658

0 commit comments

Comments
 (0)