comparison src/status.c @ 12444:410462ce25ba

[gaim-migrate @ 14751] There's no need to explicitly make sure this attribute exists - if it doesn't the hash table lookup will return NULL anyway committer: Tailor Script <tailor@pidgin.im>
author Stu Tomlinson <stu@nosnilmot.com>
date Fri, 09 Dec 2005 13:16:09 +0000
parents d7dc4b33fd69
children 8afd25a37b35
comparison
equal deleted inserted replaced
12443:488a305f9aff 12444:410462ce25ba
960 } 960 }
961 961
962 GaimValue * 962 GaimValue *
963 gaim_status_get_attr_value(const GaimStatus *status, const char *id) 963 gaim_status_get_attr_value(const GaimStatus *status, const char *id)
964 { 964 {
965 GaimStatusType *status_type;
966 GaimStatusAttr *attr;
967
968 g_return_val_if_fail(status != NULL, NULL); 965 g_return_val_if_fail(status != NULL, NULL);
969 g_return_val_if_fail(id != NULL, NULL); 966 g_return_val_if_fail(id != NULL, NULL);
970
971 status_type = gaim_status_get_type(status);
972
973 /* Make sure this attribute exists. */
974 attr = gaim_status_type_get_attr(status_type, id);
975
976 if (attr == NULL)
977 return NULL;
978 967
979 return (GaimValue *)g_hash_table_lookup(status->attr_values, id); 968 return (GaimValue *)g_hash_table_lookup(status->attr_values, id);
980 } 969 }
981 970
982 gboolean 971 gboolean