comparison libpurple/protocols/msn/slp.c @ 24350:e71c1fad229f

cmdproc->data should never be null. Log a warning message if it is (this is the same type of message logged by g_return_if_fail, right?)
author Mark Doliner <mark@kingant.net>
date Thu, 13 Nov 2008 09:19:17 +0000
parents bceefbae1ca6
children b44e1bbd5b4a
comparison
equal deleted inserted replaced
24347:f18f37a62971 24350:e71c1fad229f
756 session = cmdproc->servconn->session; 756 session = cmdproc->servconn->session;
757 slplink = msn_session_get_slplink(session, msg->remote_user); 757 slplink = msn_session_get_slplink(session, msg->remote_user);
758 758
759 if (slplink->swboard == NULL) 759 if (slplink->swboard == NULL)
760 { 760 {
761 /* We will need this in order to change its flags. */ 761 if (cmdproc->data == NULL)
762 slplink->swboard = (MsnSwitchBoard *)cmdproc->data; 762 g_warning("msn_p2p_msg cmdproc->data was NULL\n");
763 /* If swboard is NULL, something has probably gone wrong earlier on 763 else {
764 * I didn't want to do this, but MSN 7 is somehow causing us to crash 764 /*
765 * here, I couldn't reproduce it to debug more, and people are 765 * We will swboard in order to change its flags. If its
766 * reporting bugs. Hopefully this doesn't cause more crashes. Stu. 766 * NULL, something has probably gone wrong earlier on. I
767 */ 767 * didn't want to do this, but MSN 7 is somehow causing us
768 if (slplink->swboard != NULL) 768 * to crash here, I couldn't reproduce it to debug more,
769 * and people are reporting bugs. Hopefully this doesn't
770 * cause more crashes. Stu.
771 */
772 slplink->swboard = (MsnSwitchBoard *)cmdproc->data;
769 slplink->swboard->slplinks = g_list_prepend(slplink->swboard->slplinks, slplink); 773 slplink->swboard->slplinks = g_list_prepend(slplink->swboard->slplinks, slplink);
770 else 774 }
771 purple_debug_error("msn", "msn_p2p_msg, swboard is NULL, ouch!\n");
772 } 775 }
773 776
774 msn_slplink_process_msg(slplink, msg); 777 msn_slplink_process_msg(slplink, msg);
775 } 778 }
776 779