info: Merge nested if statements

This commit is contained in:
sdburns1998
2019-07-07 14:41:11 +02:00
parent fb90fec070
commit 2f32c50353
2 changed files with 9 additions and 15 deletions

View File

@@ -147,13 +147,10 @@ public class InfoPanel extends PluginPanel
emailLabel.enableAutoLinkHandler(false);
emailLabel.addHyperlinkListener(e ->
{
if (HyperlinkEvent.EventType.ACTIVATED.equals(e.getEventType()) && e.getURL() != null)
{
if (e.getURL().toString().equals(RUNELITE_LOGIN))
if (HyperlinkEvent.EventType.ACTIVATED.equals(e.getEventType()) && e.getURL() != null && e.getURL().toString().equals(RUNELITE_LOGIN))
{
executor.execute(sessionManager::login);
}
}
});
versionPanel.add(version);

View File

@@ -68,9 +68,7 @@ public class JRichTextPane extends JEditorPane
{
linkHandler = e ->
{
if (HyperlinkEvent.EventType.ACTIVATED.equals(e.getEventType()) && e.getURL() != null)
{
if (Desktop.isDesktopSupported())
if (HyperlinkEvent.EventType.ACTIVATED.equals(e.getEventType()) && e.getURL() != null && Desktop.isDesktopSupported())
{
try
{
@@ -81,7 +79,6 @@ public class JRichTextPane extends JEditorPane
log.warn("Error opening link", ex);
}
}
}
};
addHyperlinkListener(linkHandler);
}