libnm-glib: don't crash when adding new connections that aren't waited upon

If we're not waiting for this connection to show up after an
AddConnection operation, we don't need to touch anything
addinfo-related.
This commit is contained in:
Dan Williams 2011-01-17 23:19:25 -06:00
parent e041fabcfd
commit 7fa1a62cd3

View file

@ -155,6 +155,8 @@ add_connection_info_complete (NMRemoteSettings *self,
AddConnectionInfo *info,
GError *error)
{
g_return_if_fail (info != NULL);
info->callback (info->self, error ? NULL : info->connection, error, info->callback_data);
add_connection_info_dispose (self, info);
}
@ -242,7 +244,8 @@ connection_init_result_cb (NMRemoteConnection *remote,
/* If there's a pending AddConnection request, complete that here before
* signaling new-connection.
*/
add_connection_info_complete (self, addinfo, NULL);
if (addinfo)
add_connection_info_complete (self, addinfo, NULL);
/* Finally, let users know of the new connection now that it has all
* its settings and is valid.