Fix crash on shutdown, if Bluetooth not enabled (#3686)

Previously attempted to call deinit method for a nullptr
This commit is contained in:
todd-herbert
2024-04-22 00:25:58 +12:00
committed by GitHub
parent f6cfdfe881
commit dfc43bae18

View File

@@ -213,7 +213,8 @@ void doDeepSleep(uint32_t msecToWake, bool skipPreflight = false)
#ifdef ARCH_ESP32
// Full shutdown of bluetooth hardware
nimbleBluetooth->deinit();
if (nimbleBluetooth)
nimbleBluetooth->deinit();
#endif
#ifdef ARCH_ESP32