fix(network_info_plus): Return null for Linux subnet mask and broadcast when IPv4 data is missing - #3982
Merged
Conversation
…st when IPv4 data is missing `_getSubnetMask` cast a missing prefix to `int`, throwing a TypeError when there was no primary connection, no ip4Config or empty addressData. `_getBroadcast` now also returns null instead of computing a bogus value from zero fallbacks. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…st when IPv4 data is missing `_getSubnetMask` cast a missing prefix to `int`, throwing a TypeError when there was no primary connection, no ip4Config or empty addressData. `_getBroadcast` now also returns null instead of computing a bogus value from zero fallbacks. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
vbuberen
force-pushed
the
network_info_plus_linux_null_subnet
branch
from
September 28, 2026 12:32
8b5f34f to
951d027
Compare
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…or on Windows example Newer MSVC in the windows-latest image turns STL1011 into a hard error, which breaks permission_handler_windows. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
On Linux,
_getSubnetMaskdiddata?.firstOrNull?['prefix'] as int. When there is no primary connection, noip4Config, or emptyaddressData, this castsnulltointand throws aTypeError, sogetWifiSubmask()andgetWifiBroadcast()threw instead of returningnullas theirFuture<String?>signature promises.Changes:
_getSubnetMaskreads the prefix asint?and returnsnullwhen it is missing._getBroadcastreturnsnullwhen either the address or the mask is missing, instead of computing a bogus broadcast from?? 0fallbacks.NetworkManagerClient/NetworkManagerActiveConnection/NetworkManagerIP4Configcovering primaryConnection null, ip4Config null and empty addressData. Each assertsgetWifiSubmask(),getWifiBroadcast()andgetWifiIP()returnnull. All three fail without the fix.Note for reviewers:
@TestOn('linux')was dropped fromnetwork_info_plus_linux_test.dartsince the tests use fakes and run on any host. #3942 makes the same change to this file with the same fake-class style, so whichever merges second will have a trivial conflict (keep both test groups and share the fakes).Related Issues
Checklist
CHANGELOG.mdnor the plugin version inpubspec.yamlfiles.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?
!in the title as explained in Conventional Commits).🤖 Generated with Claude Code