cli: check we have an active connection before showing hint

If the activation fails even before the active connection instance is
created, we get the following:

 $ nmcli connection up vpn1
 libnm-CRITICAL **: nm_active_connection_get_connection: assertion 'NM_IS_ACTIVE_CONNECTION (connection)' failed
 nmcli-CRITICAL **: active_connection_hint: assertion 'connection' failed
 Error: Connection activation failed: Not authorized to control networking.

Check that we have an active connection before showing the hint.

Fixes: bc6c042d54
This commit is contained in:
Beniamino Galvani 2018-10-10 08:59:09 +02:00
parent c925b72e1f
commit c0fc85f3c4

View file

@ -2352,6 +2352,9 @@ active_connection_hint (GString *return_text,
const GPtrArray *devices;
guint i;
if (!active)
return;
if (!nm_streq (NM_CONFIG_DEFAULT_LOGGING_BACKEND, "journal"))
return;