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

Message.replies can throw exception if there are no replies #188

Open
nylipton opened this issue Dec 5, 2020 · 2 comments
Open

Message.replies can throw exception if there are no replies #188

nylipton opened this issue Dec 5, 2020 · 2 comments

Comments

@nylipton
Copy link

nylipton commented Dec 5, 2020

Error: type 'String' is not a subtype of type 'int' of 'index'
Message.replies (package:draw/src/models/message.dart:53:37)

This occurs when there is a message with no replies. I believe the issue is that data['replies'] returns "" instead of null.

Also, FWIW, there is a typo in the method doc. It should be "Returns an empty list" instead of "Returns and empty list."

@SupremeDeity
Copy link
Contributor

I know this is late but:

  1. Once i get to this point in my app, I will test and provide a solution

  2. A full stack detail would have been handy, as i am not sure if its you doing something wrong or DRAW, because this error means you are trying to access a Map<int, dynamic> or a List with a String using the [ ] operator. Which would just not work.

@SupremeDeity
Copy link
Contributor

This should get fixed as #204 gets resolved.

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