summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBeniamino Galvani <bgalvani@redhat.com>2018-10-10 08:59:09 +0200
committerBeniamino Galvani <bgalvani@redhat.com>2018-10-11 18:40:54 +0200
commitc0fc85f3c402b096fdaa7907a5f7824d09d0c4dd (patch)
tree91850cf5528e92dde3e36a0ef6fc15c34a4e0214
parentc925b72e1f8869c5e7b2763f13ae0db5763229aa (diff)
downloadNetworkManager-c0fc85f3c402b096fdaa7907a5f7824d09d0c4dd.tar.gz
cli: check we have an active connection before showing hintbg/fix-hint-assertion
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
-rw-r--r--clients/cli/connections.c3
1 files changed, 3 insertions, 0 deletions
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;