Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The getter 'connectionStatus' was called on null #87

Closed
milosjovac opened this issue Apr 4, 2019 · 4 comments
Closed

The getter 'connectionStatus' was called on null #87

milosjovac opened this issue Apr 4, 2019 · 4 comments

Comments

@milosjovac
Copy link

image

image

Flutter

@shamblett
Copy link
Owner

Yep, I'll put a fix in

noordawod added a commit to noordawod/mqtt_client that referenced this issue Apr 6, 2019
@noordawod
Copy link
Contributor

pr #89 is meant to fix this, and few other NPEs. Awaiting the maintainer for merging.

@yolkhovyy
Copy link

yolkhovyy commented Apr 21, 2019

I think I observe the called on null also here (when connection gets lost, I guess):

  int publishMessage(
      String topic, MqttQos qualityOfService, typed.Uint8Buffer data,
      {bool retain = false}) {
    if (_connectionHandler.connectionStatus.state !=
        MqttConnectionState.connected) {
      throw ConnectionException(_connectionHandler.connectionStatus.state);
    }
    try {
      final PublicationTopic pubTopic = PublicationTopic(topic);
      return _publishingManager.publish(
          pubTopic, qualityOfService, data, retain);
    } on Exception catch (e) {
      throw InvalidTopicException(e.toString(), topic);
    }
  }

I use the client with IoT Watson MQTT server - I think it forces connection break twice a day.

@shamblett
Copy link
Owner

Client updated as above, re-published at 5.5.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants