ESContactAlertsController should abort its event when it can not find the contact that it should send the message to. adium-1.5.2
authorThijs Alkemade <thijsalkemade@gmail.com>
Fri, 08 Jun 2012 13:17:40 +0200
branchadium-1.5.2
changeset 4854b9d9c8a21067
parent 4852 8b73767eed26
child 4855 90ccc4c599df
child 4867 d78e9b1cdc69
ESContactAlertsController should abort its event when it can not find the contact that it should send the message to.

Fixes #15787
Plugins/Send Message Contact Alert/ESSendMessageContactAlertPlugin.m
     1.1 --- a/Plugins/Send Message Contact Alert/ESSendMessageContactAlertPlugin.m	Fri Jun 08 01:49:48 2012 +0200
     1.2 +++ b/Plugins/Send Message Contact Alert/ESSendMessageContactAlertPlugin.m	Fri Jun 08 13:17:40 2012 +0200
     1.3 @@ -106,6 +106,12 @@
     1.4  
     1.5  	destUniqueID = [details objectForKey:KEY_MESSAGE_SEND_TO];
     1.6  	if (destUniqueID) contact = (AIListContact *)[adium.contactController existingListObjectWithUniqueID:destUniqueID];
     1.7 +	
     1.8 +	/* I'm not sure how this can actually end up here, but apparently if the user has 2 or more accounts, one
     1.9 +	 * with a pending message for a meta-contact on 2 accounts, and the other connects first, this event will
    1.10 +	 * fire, but contact will be nil. (#15787).
    1.11 +	 */
    1.12 +	if (!contact) return FALSE;
    1.13  
    1.14  	//Message to send and other options
    1.15  	useAnotherAccount = [[details objectForKey:KEY_MESSAGE_OTHER_ACCOUNT] boolValue];