Commit 51974196 authored by Lubomir Rintel's avatar Lubomir Rintel 🥕

cli: Only escape VPN banner if it's present

If the connection is in ACTIVATING state, the banner is still NULL.
parent 9f5cff0b
......@@ -1175,7 +1175,8 @@ nmc_active_connection_details (NMActiveConnection *acon, NmCli *nmc)
NMSettingConnection *s_con;
NMSettingVpn *s_vpn;
NMVpnConnectionState vpn_state;
char *type_str, *banner_str, *vpn_state_str;
char *type_str, *banner_str = NULL, *vpn_state_str;
const char *banner;
const char *username = NULL;
char **vpn_data_array = NULL;
guint32 items_num;
......@@ -1208,7 +1209,9 @@ nmc_active_connection_details (NMActiveConnection *acon, NmCli *nmc)
type_str = get_vpn_connection_type (con);
banner_str = g_strescape (nm_vpn_connection_get_banner (NM_VPN_CONNECTION (acon)), "");
banner = nm_vpn_connection_get_banner (NM_VPN_CONNECTION (acon));
if (banner)
banner_str = g_strescape (banner, "");
vpn_state = nm_vpn_connection_get_vpn_state (NM_VPN_CONNECTION (acon));
vpn_state_str = g_strdup_printf ("%d - %s", vpn_state, vpn_connection_state_to_string (vpn_state));
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment