From 9729f98c6696bca42ed10da9f21e56e2674c0833 Mon Sep 17 00:00:00 2001 From: Rasarts Date: Fri, 28 Jul 2017 16:22:25 +0300 Subject: [PATCH] Change type of parameter for method _processMqttMessage --- lib/mqtt_client.dart | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/mqtt_client.dart b/lib/mqtt_client.dart index 8abec4f..68c3dbe 100644 --- a/lib/mqtt_client.dart +++ b/lib/mqtt_client.dart @@ -200,8 +200,11 @@ class MqttClient { * * Return the data that has not been processed */ - List _processMqttMessage(ByteBuffer details) { - var data = details.asInt8List(); + List _processMqttMessage(dynamic details) { + var data = details; + + if (details.runtimeType.toString() != 'Uint8List') data = details.asInt8List(); + num type = data[0] >> 4; int msgProcessedLength = data.length;