libnm-glib: fix up nm_vpn_connection_get_banner()

We need to get current vpn_state in order for nm_vpn_connection_get_banner() to
work properly even if vpn_state had not been set before.
This commit is contained in:
Jiří Klimeš
2012-01-05 11:37:41 +01:00
parent fa5465a746
commit decfaa41ef

View File

@@ -98,6 +98,10 @@ nm_vpn_connection_get_banner (NMVPNConnection *vpn)
g_return_val_if_fail (NM_IS_VPN_CONNECTION (vpn), NULL);
priv = NM_VPN_CONNECTION_GET_PRIVATE (vpn);
/* We need to update vpn_state first in case it's unknown. */
nm_vpn_connection_get_vpn_state (vpn);
if (priv->vpn_state != NM_VPN_CONNECTION_STATE_ACTIVATED)
return NULL;