diff --git a/lib/src/connectionhandling/mqtt_connection_base.dart b/lib/src/connectionhandling/mqtt_connection_base.dart index aa11fd0..1355c78 100644 --- a/lib/src/connectionhandling/mqtt_connection_base.dart +++ b/lib/src/connectionhandling/mqtt_connection_base.dart @@ -77,7 +77,12 @@ class MqttConnectionBase { // On disconnect clean(discard) anything in the message stream messageStream.clean(); if (client != null) { - client.destroy(); + // TODO needs a proper fix, see issue 111 + try { + client.destroy(); + } on NoSuchMethodError { + client.close(); + } client = null; } }