settings: fix failed assertion

Fix the following assertion failure:

  g_object_ref: assertion 'G_IS_OBJECT (object)' failed.

nm_settings_add_connection() can return a NULL connection.

Fixes: f034f17ff6 ('settings: keep the added connection alive for a bit longer')
(cherry picked from commit 48ce3628c5)
(cherry picked from commit d80818e6ca)
This commit is contained in:
Beniamino Galvani 2019-04-23 11:10:33 +02:00
parent 764ad1b191
commit b7cd8f283b

View file

@ -1174,7 +1174,7 @@ pk_add_cb (NMAuthChain *chain,
* because it's found to be incompatible with the device on AddAndActivate).
* But we need to keep it alive for a bit longer, precisely to check wehther
* it's still known to the setting manager. */
g_object_ref (added);
nm_g_object_ref (added);
}
callback = nm_auth_chain_get_data (chain, "callback");