diff --git a/src/rf95/Router.cpp b/src/rf95/Router.cpp index 6b949c1f..dff4b779 100644 --- a/src/rf95/Router.cpp +++ b/src/rf95/Router.cpp @@ -51,9 +51,13 @@ void Router::loop() */ ErrorCode Router::send(MeshPacket *p) { - assert(iface); - DEBUG_MSG("Sending packet via interface fr=0x%x,to=0x%x,id=%d\n", p->from, p->to, p->id); - return iface->send(p); + if (iface) { + DEBUG_MSG("Sending packet via interface fr=0x%x,to=0x%x,id=%d\n", p->from, p->to, p->id); + return iface->send(p); + } else { + DEBUG_MSG("Dropping packet - no interfaces - fr=0x%x,to=0x%x,id=%d\n", p->from, p->to, p->id); + return ERRNO_NO_INTERFACES; + } } #include "GPS.h"