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
This commit is contained in:
Cosimo Cecchi 2017-03-20 18:07:47 +00:00
parent f785f4ad02
commit 6f473a4f29

View File

@ -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;