Skip to content

Conversation

@utilisateursrichard
Copy link

@utilisateursrichard utilisateursrichard commented Jan 19, 2026

This PR fixes a TypeError that appears in logs (and potentially affects UI rendering) when a connection is removed while devices is undefined.

The issue:
In _connectionRemoved, the code accesses devices.length without checking if devices exists. This can happen during specific wake-from-sleep scenarios or network resets.

The fix:
Added a null check (if (devices)) before iterating over the devices list.

Verification:
Tested locally on Linux Mint. The error no longer appears in logs when network state changes.

issue found here : #12721

Copilot AI review requested due to automatic review settings January 19, 2026 21:19
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a TypeError that occurs in the network applet when _connectionRemoved tries to access the devices property without checking if it exists first. This can happen during network state changes such as wake-from-sleep scenarios.

Changes:

  • Added null safety check for this._devices[section] and this._devices[section].devices before iterating over devices in _connectionRemoved method

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@utilisateursrichard
Copy link
Author

the issue was found in #12721 btw

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.

1 participant