File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,8 @@ static unsigned long getTime() {
18
18
ArduinoIoTCloudClass::ArduinoIoTCloudClass () :
19
19
_thing_id (" " ),
20
20
_bearSslClient(NULL ),
21
- _mqttClient (NULL )
21
+ _mqttClient (NULL ),
22
+ connection (NULL )
22
23
{
23
24
}
24
25
@@ -265,12 +266,15 @@ void ArduinoIoTCloudClass::handleMessage(int length)
265
266
}
266
267
267
268
void ArduinoIoTCloudClass::connectionCheck () {
268
- connection->check ();
269
- if (connection->getStatus () != CONNECTION_STATE_CONNECTED) {
270
- if (iotStatus == IOT_STATUS_CLOUD_CONNECTED)
271
- iotStatus = IOT_STATUS_CLOUD_DISCONNECTED;
272
- return ;
269
+ if (connection != NULL ){
270
+ connection->check ();
271
+ if (connection->getStatus () != CONNECTION_STATE_CONNECTED) {
272
+ if (iotStatus == IOT_STATUS_CLOUD_CONNECTED)
273
+ iotStatus = IOT_STATUS_CLOUD_DISCONNECTED;
274
+ return ;
275
+ }
273
276
}
277
+
274
278
char msgBuffer[120 ];
275
279
int arduinoIoTConnectionAttempt;
276
280
You can’t perform that action at this time.
0 commit comments