info button throws a NullPointerException when there's no selected contact: Bug fixed.

cusax-fix
Yana Stamcheva 20 years ago
parent b9b5a8fca1
commit f2d29276f1

@ -107,9 +107,7 @@ private void init() {
this.configureButton.addActionListener(this);
this.searchButton.addActionListener(this);
this.infoButton.addActionListener(this);
//Disable all buttons that do nothing.
this.configureButton.setEnabled(false);
}
public void actionPerformed(ActionEvent e) {
@ -228,17 +226,20 @@ else if (buttonName.equals("info")) {
(MetaContact) mainFrame.getTabbedPane().getContactListPanel()
.getContactList().getSelectedValue();
Contact defaultContact = selectedMetaContact.getDefaultContact();
ProtocolProviderService defaultProvider
= defaultContact.getProtocolProvider();
OperationSetWebContactInfo wContactInfo
= mainFrame.getWebContactInfo(defaultProvider);
BrowserLauncher.openURL(
wContactInfo.getWebContactInfo(defaultContact)
.toString());
if(selectedMetaContact != null) {
Contact defaultContact = selectedMetaContact
.getDefaultContact();
ProtocolProviderService defaultProvider
= defaultContact.getProtocolProvider();
OperationSetWebContactInfo wContactInfo
= mainFrame.getWebContactInfo(defaultProvider);
BrowserLauncher.openURL(
wContactInfo.getWebContactInfo(defaultContact)
.toString());
}
}
}

Loading…
Cancel
Save