fix null pointer exception in storeandforwardplugin. if null the vtable is busted

cc @mc-hamster.  In some cases storeForwardPluginRadio can be null ;-)

~/development/meshtastic/meshtastic-esp32$ bin/exception_decoder.py -e .pio/build/tbeam/firmware.elf ex
stack:
0x401db467: StoreForwardPluginRadio::sendPayload(unsigned int, bool) at /home/kevinh/development/meshtastic/meshtastic-esp32/src/plugins/esp32/StoreForwardPlugin.cpp:235
0x400e7cbd: StoreForwardPlugin::runOnce() at /home/kevinh/development/meshtastic/meshtastic-esp32/src/plugins/esp32/StoreForwardPlugin.cpp:225
0x400d4cca: concurrency::OSThread::run() at /home/kevinh/development/meshtastic/meshtastic-esp32/src/concurrency/OSThread.cpp:45
0x400f015d: ThreadController::runOrDelay() at /home/kevinh/development/meshtastic/meshtastic-esp32/.pio/libdeps/tbeam/Thread/ThreadController.cpp:153
0x400da070: loop() at /home/kevinh/development/meshtastic/meshtastic-esp32/src/main.cpp:621
0x400ff709: loopTask(void*) at /home/kevinh/.platformio/packages/framework-arduinoespressif32/cores/esp32/main.cpp:19

Signed-off-by: Kevin Hester <kevinh@geeksville.com>
1.2-legacy
Kevin Hester 2021-03-11 18:53:17 +08:00
rodzic a97c2ae6eb
commit 2d6261703a
1 zmienionych plików z 2 dodań i 1 usunięć

Wyświetl plik

@ -83,7 +83,8 @@ int32_t StoreForwardPlugin::runOnce()
DEBUG_MSG("Store & Forward Plugin - Sending heartbeat\n");
// storeForwardPluginRadio->sendPayloadHeartbeat();
storeForwardPluginRadio->sendPayload();
if(storeForwardPluginRadio)
storeForwardPluginRadio->sendPayload();
return (1 * 60 * 1000);
}