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() {
1818ArduinoIoTCloudClass::ArduinoIoTCloudClass () :
1919 _thing_id (" " ),
2020 _bearSslClient(NULL ),
21- _mqttClient (NULL )
21+ _mqttClient (NULL ),
22+ connection (NULL )
2223{
2324}
2425
@@ -265,12 +266,15 @@ void ArduinoIoTCloudClass::handleMessage(int length)
265266}
266267
267268void 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+ }
273276 }
277+
274278 char msgBuffer[120 ];
275279 int arduinoIoTConnectionAttempt;
276280
You can’t perform that action at this time.
0 commit comments