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

Fix provider null return value #216

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

yuwen-yan
Copy link
Collaborator

@yuwen-yan yuwen-yan commented Dec 31, 2019

Follow-up PR for #202

Copy link
Contributor

@luigi-rosso luigi-rosso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is cleaner, thank you. I'm curious though, how was the provider returning null prior to these changes?

@yuwen-yan
Copy link
Collaborator Author

yuwen-yan commented Jan 7, 2020

@luigi-rosso it's about error handling, AFAIK, there are two ways to fail:

  • Throw exception in AssetProvider.load() , in this case, we should raise this exception to client application and show nothing.
  • Return invalid ByteData (including null) by AssetProvider.load(), in this case, right now we will raise an exception when exec FlutterActor.loadFromByteData(data).

I was thinking that we should suppress the exception for invalid ByteData, but after a second thought, I think it's also ok to raise it, WDYT? So I'm going to hold this PR for now..

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

Successfully merging this pull request may close these issues.

2 participants