Skip to content

fix: catch pubspec.yaml asset loading errors to prevent crashes - #334

Open
stephenmcd wants to merge 1 commit into
mainfrom
fix/platform-interface-version-crash
Open

fix: catch pubspec.yaml asset loading errors to prevent crashes#334
stephenmcd wants to merge 1 commit into
mainfrom
fix/platform-interface-version-crash

Conversation

@stephenmcd

Copy link
Copy Markdown
Contributor

Wrap rootBundle.loadString and yaml parsing in a try-catch block inside Configurations._getPackageConfiguration(). Fallback to 'unknown' version instead of crashing if the pubspec.yaml asset cannot be loaded in specific environments (e.g. AAR packaging or custom asset pipelines). Add corresponding unit test.

Closes #331

⚠️
Hello, and thank you for your contributions!

Please review the following checklist before creating a new pull request:

  • Review and contribute to existing pull requests and open issues to avoid redundant efforts.
  • Read the contribution guidelines.
  • Assign reviewers.
  • If applicable, include a reference to related issues.
  • If this is a new feature, create an issue and coordinate with other contributors to make sure the feature can be made available in all platforms supported.

⚠️ Delete this block before creating the pull request.

Describe the changes proposed

A clear and concise description of the changes included in this pull request.

Screenshots / Videos

If useful, include any screeshots or screencasts to better explain the change.

Additional context

Add any other context about the change here.

Wrap rootBundle.loadString and yaml parsing in a try-catch block inside Configurations._getPackageConfiguration(). Fallback to 'unknown' version instead of crashing if the pubspec.yaml asset cannot be loaded in specific environments (e.g. AAR packaging or custom asset pipelines). Add corresponding unit test.

Closes #331
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.

Unable to load asset: "packages/pay_platform_interface/pubspec.yaml".

1 participant