From f2d29276f1f67246af0fb9f8af2d456c5301ffb6 Mon Sep 17 00:00:00 2001 From: Yana Stamcheva Date: Tue, 18 Jul 2006 16:03:44 +0000 Subject: [PATCH] info button throws a NullPointerException when there's no selected contact: Bug fixed. --- .../communicator/impl/gui/main/QuickMenu.java | 29 ++++++++++--------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/src/net/java/sip/communicator/impl/gui/main/QuickMenu.java b/src/net/java/sip/communicator/impl/gui/main/QuickMenu.java index 499e20420..0376a25e0 100755 --- a/src/net/java/sip/communicator/impl/gui/main/QuickMenu.java +++ b/src/net/java/sip/communicator/impl/gui/main/QuickMenu.java @@ -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()); + } } }