network: Handle networks with no access points

This avoids a couple of warnings when encountering such a network.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/76
This commit is contained in:
Florian Müllner 2018-03-02 23:31:36 +01:00 committed by Jonas Ådahl
parent 7a3927c168
commit c15e163eb1

View File

@ -995,8 +995,16 @@ var NMWirelessDialog = new Lang.Class({
else if (!oneHasConnection && twoHasConnection)
return 1;
let oneStrength = one.accessPoints[0].strength;
let twoStrength = two.accessPoints[0].strength;
let oneAp = one.accessPoints[0] || null;
let twoAp = two.accessPoints[0] || null;
if (oneAp != null && twoAp == null)
return -1;
else if (oneAp == null && twoAp != null)
return 1;
let oneStrength = oneAp.strength;
let twoStrength = twoAp.strength;
// place stronger connections first
if (oneStrength != twoStrength)