[gnome-shell] network: don't assume the connection path is always non-NULL



commit 6f473a4f29f55ba25e4b47a97ce54874d51b43e3
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Mon Mar 20 18:07:47 2017 +0000

    network: don't assume the connection path is always non-NULL
    
    It can be NULL according to the libnm-glib documentation.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=780321

 js/ui/status/network.js |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/js/ui/status/network.js b/js/ui/status/network.js
index 4f23fd3..e86e89f 100644
--- a/js/ui/status/network.js
+++ b/js/ui/status/network.js
@@ -1362,7 +1362,11 @@ const NMDeviceWireless = new Lang.Class({
         if (!this._device.active_connection)
             return false;
 
-        let connection = this._settings.get_connection_by_path(this._device.active_connection.connection);
+        let connectionPath = this._device.active_connection.connection;
+        if (!connectionPath)
+            return false;
+
+        let connection = this._settings.get_connection_by_path(connectionPath);
         if (!connection)
             return false;
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]