From c0fc85f3c402b096fdaa7907a5f7824d09d0c4dd Mon Sep 17 00:00:00 2001 From: Beniamino Galvani Date: Wed, 10 Oct 2018 08:59:09 +0200 Subject: 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: bc6c042d5461028a2fac53ffcdb36837e596a1a5 --- clients/cli/connections.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/clients/cli/connections.c b/clients/cli/connections.c index 6cc886870f..ce549712f1 100644 --- a/clients/cli/connections.c +++ b/clients/cli/connections.c @@ -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; -- cgit v1.2.1