[gnome-shell/gnome-3-22] network: Avoid JS error when activating VPN connection
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/gnome-3-22] network: Avoid JS error when activating VPN connection
- Date: Tue, 27 Dec 2016 18:15:41 +0000 (UTC)
commit b30a528225845d0dc5f1e4e1d62f66f344ae34ef
Author: Michael Catanzaro <mcatanzaro gnome org>
Date: Tue Dec 20 14:00:42 2016 -0600
network: Avoid JS error when activating VPN connection
If the call to settings.get_connection_by_path in
ensureActiveConnectionProps returns null, we'll hit a JS error here.
Seems to happen always when activating a VPN connection. Avoid that.
Giovanni says:
"I believe this is papering over an existing bug, but it's possible for
settings.get_connection_by_path() to legitimately return null (if the
connection is owned by a different user and invisible to the current
one), so the fix is correct anyway."
https://bugzilla.gnome.org/show_bug.cgi?id=759793
js/ui/status/network.js | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/js/ui/status/network.js b/js/ui/status/network.js
index 0bb53bb..337ea3f 100644
--- a/js/ui/status/network.js
+++ b/js/ui/status/network.js
@@ -1541,8 +1541,10 @@ const NMVPNSection = new Lang.Class({
item.setActiveConnection(null);
}
vpnConnections.forEach(Lang.bind(this, function(a) {
- let item = this._connectionItems.get(a._connection.get_uuid());
- item.setActiveConnection(a);
+ if (a._connection) {
+ let item = this._connectionItems.get(a._connection.get_uuid());
+ item.setActiveConnection(a);
+ }
}));
},
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]