# HG changeset patch # User Ethan Blanton # Date 1134104830 0 # Node ID 1811afd29b57c22e6c5a717fd14e84238303bd6f # Parent 74d5a423433cd835e8fa03dc83652ad2baa30e27 [gaim-migrate @ 14741] OSCAR, at least, is guilty of setting status messages on statuses which do not accept a message with some regularity. I'm betting other protocols have similar errors. This causes such errors to be logged as an error to the debug window, so that they can be tracked down and fixed. In general, we seem to be abusing g_return_if_fail -- it's intended to be an *assertion*, not a shortcut for normal return conditions. I think it complains (or can complain) to the debug window itself ... maybe we need to make it louder. committer: Tailor Script diff -r 74d5a423433c -r 1811afd29b57 src/status.c --- a/src/status.c Fri Dec 09 05:05:06 2005 +0000 +++ b/src/status.c Fri Dec 09 05:07:10 2005 +0000 @@ -865,7 +865,18 @@ /* Make sure this attribute exists and is the correct type. */ attr_value = gaim_status_get_attr_value(status, id); - g_return_if_fail(attr_value != NULL); + /* This used to be g_return_if_fail, but it's failing a LOT, so + * let's generate a log error for now. */ + /* g_return_if_fail(attr_value != NULL); */ + if (attr_value == NULL) { + gaim_debug_error("status", + "Attempted to set status attribute '%s' for " + "status '%s', which is not legal. Fix " + "this!\n", id, + gaim_status_type_get_name(gaim_status_get_type(status))); + return; + + } g_return_if_fail(gaim_value_get_type(attr_value) == GAIM_TYPE_STRING); gaim_value_set_string(attr_value, value);