libnm-core: don't set GError on invalid @connection argument in _nm_connection_verify()

In general, we don't set errors if passing a completely invalid @self
pointer to a method. We usually also don't set the error argument
when asserting. So, just drop it.

Signed-off-by: Thomas Haller <thaller@redhat.com>
This commit is contained in:
Thomas Haller 2014-07-03 18:54:43 +02:00
parent 1effc604cb
commit b87ed28f01

View file

@ -671,16 +671,8 @@ _nm_connection_verify (NMConnection *connection, GError **error)
GError *normalizable_error = NULL;
NMSettingVerifyResult normalizable_error_type = NM_SETTING_VERIFY_SUCCESS;
if (error)
g_return_val_if_fail (*error == NULL, NM_SETTING_VERIFY_ERROR);
if (!NM_IS_CONNECTION (connection)) {
g_set_error_literal (error,
NM_SETTING_CONNECTION_ERROR,
NM_SETTING_CONNECTION_ERROR_UNKNOWN,
"invalid connection; failed verification");
g_return_val_if_fail (NM_IS_CONNECTION (connection), NM_SETTING_VERIFY_ERROR);
}
g_return_val_if_fail (NM_IS_CONNECTION (connection), NM_SETTING_VERIFY_ERROR);
g_return_val_if_fail (!error || !*error, NM_SETTING_VERIFY_ERROR);
priv = NM_CONNECTION_GET_PRIVATE (connection);