diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2008-04-30 11:29:43 +0000 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2008-04-30 11:29:43 +0000 |
commit | 03b7e2926a54c2ae61df7e80a401a9893809828c (patch) | |
tree | 88a4ead0dd51900e4991a97055f3e476fa3e800b | |
parent | 4c9bd9a6931313170d0317789e4ef47824b610e0 (diff) |
TpDynamicHandleRepo: in tp_handle_lookup() implementation, raise NotAvailable if the ID is valid but there is no handle, rather than returning 0 with no error (closes fd.o #15387)
-rw-r--r-- | telepathy-glib/handle-repo-dynamic.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/telepathy-glib/handle-repo-dynamic.c b/telepathy-glib/handle-repo-dynamic.c index 80ba15a73..7c70f2d61 100644 --- a/telepathy-glib/handle-repo-dynamic.c +++ b/telepathy-glib/handle-repo-dynamic.c @@ -728,6 +728,14 @@ dynamic_lookup_handle (TpHandleRepoIface *irepo, handle = GPOINTER_TO_UINT (g_hash_table_lookup (self->string_to_handle, id)); + if (handle == 0) + { + g_set_error (error, TP_ERRORS, TP_ERROR_NOT_AVAILABLE, + "no %s handle (type %u) currently exists for ID \"%s\"", + tp_handle_type_to_string (self->handle_type), + self->handle_type, id); + } + g_free (normal_id); return handle; } |