diff -r 3c92ce43ddae -r c43f0fb4c511 libpurple/protocols/myspace/message.c --- a/libpurple/protocols/myspace/message.c Thu Jun 14 08:18:59 2007 +0000 +++ b/libpurple/protocols/myspace/message.c Thu Jun 14 08:21:36 2007 +0000 @@ -824,7 +824,7 @@ * * @param name Name of element. * - * @return guint Numeric representation of data, or 0 if could not be converted. + * @return guint Numeric representation of data, or 0 if could not be converted / not found. * * Useful to obtain an element's data if you know it should be an integer, * even if it is not stored as an MSIM_TYPE_INTEGER. MSIM_TYPE_STRING will @@ -836,6 +836,9 @@ elem = msim_msg_get(msg, name); + if (!elem) + return 0; + switch (elem->type) { case MSIM_TYPE_INTEGER: