libnm-glib: fix crash for AddAndActivateConnection() D-Bus call (bgo #652512)

When a partial connection is passed to nm_client_add_and_activate_connection(),
but it doesn't contain any settings, nm_connection_to_hash() returns NULL and
there's a crash later on the NULL hash.
This commit is contained in:
Jiří Klimeš 2011-06-14 19:39:23 +02:00
parent 6fe22d99f0
commit b4a72d1ad7

View file

@ -763,7 +763,7 @@ nm_client_add_and_activate_connection (NMClient *client,
if (partial)
hash = nm_connection_to_hash (partial, NM_SETTING_HASH_FLAG_ALL);
else
if (!hash)
hash = g_hash_table_new (g_str_hash, g_str_equal);
priv = NM_CLIENT_GET_PRIVATE (client);