diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2011-11-01 12:13:50 +0100 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2011-11-01 13:05:06 +0100 |
commit | 02e5923e69638efe7dcea50df48e186356fa8d0a (patch) | |
tree | 81223b008e99b4318b33f5e3b1443cca76a47ac5 | |
parent | 48d50aacbde935e0f390922e422d4b846cc55c3b (diff) |
check if we pass at least one contacts directly in the API call
The error message will be more useful to users than the one in tp-glib's
internals.
-rw-r--r-- | telepathy-glib/connection-contact-list.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/telepathy-glib/connection-contact-list.c b/telepathy-glib/connection-contact-list.c index 8034ddca..59b5b045 100644 --- a/telepathy-glib/connection-contact-list.c +++ b/telepathy-glib/connection-contact-list.c @@ -772,6 +772,7 @@ generic_callback (TpConnection *self, gboolean supplied_contacts_are_valid; \ \ g_return_if_fail (TP_IS_CONNECTION (self)); \ + g_return_if_fail (n_contacts > 0); \ \ supplied_contacts_are_valid = _tp_contacts_to_handles (self, n_contacts, \ contacts, &handles); \ @@ -1116,6 +1117,7 @@ tp_connection_get_contact_groups (TpConnection *self) \ g_return_if_fail (TP_IS_CONNECTION (self)); \ g_return_if_fail (group != NULL); \ + g_return_if_fail (n_contacts > 0); \ \ supplied_contacts_are_valid = _tp_contacts_to_handles (self, n_contacts, \ contacts, &handles); \ @@ -1419,6 +1421,7 @@ tp_connection_block_contacts_async (TpConnection *self, gboolean supplied_contacts_are_valid; g_return_if_fail (TP_IS_CONNECTION (self)); + g_return_if_fail (n_contacts > 0); supplied_contacts_are_valid = _tp_contacts_to_handles (self, n_contacts, contacts, &handles); @@ -1477,6 +1480,7 @@ tp_connection_unblock_contacts_async (TpConnection *self, gboolean supplied_contacts_are_valid; g_return_if_fail (TP_IS_CONNECTION (self)); + g_return_if_fail (n_contacts > 0); supplied_contacts_are_valid = _tp_contacts_to_handles (self, n_contacts, contacts, &handles); |