shamblett / mqtt_client

A server and browser based MQTT client for dart
Other
548 stars 176 forks source link

Getter 'published' called on null #68

Closed csanz91 closed 5 years ago

csanz91 commented 5 years ago

With the last update, version 5.3.0, I'm getting this error after the client is disconnected:

I/flutter ( 5421): Connection status is disconnected with return code solicited - (I print the status on the function onDisconnected) E/flutter ( 5421): [ERROR:flutter/shell/common/shell.cc(184)] Dart Error: Unhandled exception: E/flutter ( 5421): NoSuchMethodError: The getter 'published' was called on null. E/flutter ( 5421): Receiver: null E/flutter ( 5421): Tried calling: published

The stack trace refers to this line: https://github.com/shamblett/mqtt_client/blob/aebd4601dc4e9e130d03e597cb6ff48c1bd19041/lib/src/mqtt_client.dart#L289

which was introduced in this recent commit: https://github.com/shamblett/mqtt_client/commit/aebd4601dc4e9e130d03e597cb6ff48c1bd1904

shamblett commented 5 years ago

Yes, good catch, should of course be

_publishingManager.published?.close();

Updated for next release

shamblett commented 5 years ago

Client republished at version 5.4.0, please retest

csanz91 commented 5 years ago

Fixed! Im closing the issue now