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

@@ -445,6 +445,7 @@ class TinyGsmM95 : public TinyGsmModem<TinyGsmM95>,
}
size_t modemRead(size_t size, uint8_t mux) {
if (!sockets[mux]) return 0;
// TODO(?): Does this work????
// AT+QIRD=<id>,<sc>,<sid>,<len>
// id = GPRS context number = 0, set in GPRS connect
@@ -482,6 +483,7 @@ class TinyGsmM95 : public TinyGsmModem<TinyGsmM95>,
}
}
// Not possible to check the number of characters remaining in buffer
size_t modemGetAvailable(uint8_t) {
return 0;
}
@@ -618,6 +620,7 @@ class TinyGsmM95 : public TinyGsmModem<TinyGsmM95>,
public:
Stream& stream;
protected:
GsmClientM95* sockets[TINY_GSM_MUX_COUNT];
const char* gsmNL = GSM_NL;