Some more null pointer checks, fix #186

Signed-off-by: Sara Damiano <sdamiano@stroudcenter.org>
This commit is contained in:
Sara Damiano
2020-04-15 15:42:55 -04:00
parent b9473c65fd
commit fb3f8583a3
13 changed files with 98 additions and 59 deletions

View File

@@ -332,6 +332,7 @@ class TinyGsmTCP {
// !stream.available()" and then will wait again in the stream.read()
// function.
inline void moveCharFromStreamToFifo(uint8_t mux) {
if (!thisModem().sockets[mux]) return;
uint32_t startMillis = millis();
while (!thisModem().stream.available() &&
(millis() - startMillis < thisModem().sockets[mux]->_timeout)) {