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(device_info_plus): #2957 replaces throwing exception with returning default values #3445

Merged
merged 1 commit into from
Jan 28, 2025

Conversation

miquelbeltran
Copy link
Member

Description

As discussed in #2957 seems that some Windows VMs will return 0 when asked for physical device memory, which causes the plugin to throw an exception.

The main issue is that 3rd party devs using this plugin in their packages may not properly catch exceptions.

This PR replaces these types of exception errors with returning default values, to avoid uncaught exceptions.

Related Issues

Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I titled the PR using Conventional Commits.
  • I did not modify the CHANGELOG.md nor the plugin version in pubspec.yaml files.
  • All existing and new tests are passing.
  • The analyzer (flutter analyze) does not report any problems on my PR.

Breaking Change

Does your PR require plugin users to manually update their apps to accommodate your change?

  • Yes, this is a breaking change (please indicate that with a ! in the title as explained in Conventional Commits).
  • No, this is not a breaking change.

Copy link
Collaborator

@vbuberen vbuberen left a comment

Choose a reason for hiding this comment

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

Feels like it would be good to release this fix today

@miquelbeltran miquelbeltran merged commit 084730f into main Jan 28, 2025
20 checks passed
@miquelbeltran miquelbeltran deleted the fix/2957 branch January 28, 2025 09:51
@vbuberen vbuberen changed the title fix: #2957 replaces throwing exception with returning default values fix(device_info_plus): #2957 replaces throwing exception with returning default values Jan 28, 2025
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.

[Bug]: DeviceInfoPlugin class on Windows 10 crashes when windowsInfo is called.
2 participants