Fill error when object isn't a connection (Alexander Sack)

git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4074 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
Dan Williams
2008-09-18 13:31:11 +00:00
parent 5735b02376
commit d2ef616e51

View File

@@ -458,10 +458,17 @@ nm_connection_verify (NMConnection *connection, GError **error)
NMSetting *s_con; NMSetting *s_con;
VerifySettingsInfo info; VerifySettingsInfo info;
g_return_val_if_fail (NM_IS_CONNECTION (connection), FALSE);
if (error) if (error)
g_return_val_if_fail (*error == NULL, FALSE); g_return_val_if_fail (*error == NULL, FALSE);
if (!NM_IS_CONNECTION (connection)) {
g_set_error (error,
NM_SETTING_CONNECTION_ERROR,
NM_SETTING_CONNECTION_ERROR_UNKNOWN,
"invalid connection; failed verification");
g_return_val_if_fail (NM_IS_CONNECTION (connection), FALSE);
}
priv = NM_CONNECTION_GET_PRIVATE (connection); priv = NM_CONNECTION_GET_PRIVATE (connection);
/* First, make sure there's at least 'connection' setting */ /* First, make sure there's at least 'connection' setting */