# HG changeset patch # User Jeffrey Connelly # Date 1181809296 0 # Node ID 320b0b450c7bdf2aa1abc547f73cbe4290b201d2 # Parent f057837085b097b682aabb9a98a87cfaff3c4c08 msim_msg_get_integer() - if could not find element, return 0. diff -r f057837085b0 -r 320b0b450c7b 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: