Fixes NPE in the OTR plugin when the contact policy of a null Contact is changed.

cusax-fix 5027
Marin 13 years ago
parent 608faa413b
commit 70cc63da12

@ -220,7 +220,8 @@ else if (ACTION_COMMAND_CB_RESET.equals(actionCommand))
public void contactPolicyChanged(Contact contact)
{
// Update the corresponding to the contact menu.
if (contact.equals(OtrContactMenu.this.contact))
if (OtrContactMenu.this.contact != null &&
contact.equals(OtrContactMenu.this.contact.contact))
setOtrPolicy(OtrActivator.scOtrEngine.getContactPolicy(contact));
}

@ -72,7 +72,8 @@ public void sessionStatusChanged(OtrContact otrContact)
public void contactPolicyChanged(Contact contact)
{
// OtrMetaContactButton.this.contact can be null.
if (contact.equals(OtrMetaContactButton.this.otrContact.contact))
if (OtrMetaContactButton.this.otrContact != null &&
contact.equals(OtrMetaContactButton.this.otrContact.contact))
{
setPolicy(
OtrActivator.scOtrEngine.getContactPolicy(contact));

Loading…
Cancel
Save