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

MqttSubscriptionTopic().matches function throws exception upon different lengths of topics #77

Closed
ashu-pietech opened this issue Dec 26, 2023 · 2 comments

Comments

@ashu-pietech
Copy link
Contributor

I found that MqttSubscriptionTopic().matches function is throwing error upon comparing two different topics. But the case is that base topic's length must be greater than the comparing topic's length then it throws this error:

[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: RangeError (index): Invalid value: Not in inclusive range 0..3: 4 #0 List.[] (dart:core-patch/growable_array.dart:264:36) #1 MqttSubscriptionTopic.matches (package:mqtt5_client/src/mqtt_subscription_topic.dart:93:56)

Steps to reproduce:

  1. The raw topic passed inside the MqttSubscriptionTopic() must be of greater length if separated by "/" than the topic passed inside MqttPublicationTopic()
  2. compare both using the MqttSubscriptionTopic("passed raw topic").matches function

I've fixed the above issue and I'll create a PR

@ashu-pietech
Copy link
Contributor Author

created PR for the same issue #78

@shamblett
Copy link
Owner

Merged, package re published at version 4.2.0

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

2 participants