[gnome-shell/wip/rstrode/rhel-7.9: 53/86] network: Don't assume the active connection has been processed first
- From: Ray Strode <halfline src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/wip/rstrode/rhel-7.9: 53/86] network: Don't assume the active connection has been processed first
- Date: Fri, 12 Feb 2021 19:04:07 +0000 (UTC)
commit 1dde8667040b824626e0cfc1c72deff457186d62
Author: Iain Lane <iainl gnome org>
Date: Thu Aug 16 11:59:36 2018 +0100
network: Don't assume the active connection has been processed first
`NMConnectionDevice._sync()` is responsible for setting up the active
connection that we'll end up displaying. It expects the active
connection to already be in a map `_connectionItems`. If it isn't in
there, we get a null dereference and the indicator can get into a weird
state where it doesn't display devices / connections properly.
Let's change this expectation. If there is an active connection,
`_deviceAdded()` will eventually get to it and call `_sync()` to set up
the active connection state. We make `_sync()` tolerate there being no
active connection when it's called.
Closes: https://gitlab.gnome.org/GNOME/gnome-shell/issues/140
js/ui/status/network.js | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
---
diff --git a/js/ui/status/network.js b/js/ui/status/network.js
index a75993612b..79acef2640 100644
--- a/js/ui/status/network.js
+++ b/js/ui/status/network.js
@@ -419,12 +419,14 @@ var NMConnectionDevice = new Lang.Class({
this._deactivateItem.actor.visible = this._device.state > NM.DeviceState.DISCONNECTED;
if (this._activeConnection == null) {
- this._activeConnection = this._device.active_connection;
-
- if (this._activeConnection) {
- ensureActiveConnectionProps(this._activeConnection, this._client);
- let item = this._connectionItems.get(this._activeConnection.connection.get_uuid());
- item.setActiveConnection(this._activeConnection);
+ let activeConnection = this._device.active_connection;
+ if (activeConnection && activeConnection.connection) {
+ let item = this._connectionItems.get(activeConnection.connection.get_uuid());
+ if (item) {
+ this._activeConnection = activeConnection;
+ ensureActiveConnectionProps(this._activeConnection, this._client);
+ item.setActiveConnection(this._activeConnection);
+ }
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]