mirror of
https://github.com/eclipse/paho.mqtt.android.git
synced 2025-05-08 18:39:31 +08:00
Workaround for Issue #101
Signed-off-by: James Sutton <james.sutton@uk.ibm.com>
This commit is contained in:
parent
1fc2130480
commit
d827ef5538
@ -1067,6 +1067,17 @@ class MqttConnection implements MqttCallbackExtended {
|
||||
service.traceError(TAG, "Cannot reconnect to remote server." + e.getMessage());
|
||||
setConnectingState(false);
|
||||
handleException(resultBundle, e);
|
||||
} catch (Exception e){
|
||||
/* TODO: Added Due to: https://github.com/eclipse/paho.mqtt.android/issues/101
|
||||
For some reason in a small number of cases, myClient is null here and so
|
||||
a NullPointer Exception is thrown. This is a workaround to pass the exception
|
||||
up to the application. myClient should not be null so more investigation is
|
||||
required.
|
||||
*/
|
||||
service.traceError(TAG, "Cannot reconnect to remote server." + e.getMessage());
|
||||
setConnectingState(false);
|
||||
MqttException newEx = new MqttException(MqttException.REASON_CODE_UNEXPECTED_ERROR, e.getCause());
|
||||
handleException(resultBundle, newEx);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user