info: Merge nested if statements
This commit is contained in:
@@ -147,12 +147,9 @@ public class InfoPanel extends PluginPanel
|
|||||||
emailLabel.enableAutoLinkHandler(false);
|
emailLabel.enableAutoLinkHandler(false);
|
||||||
emailLabel.addHyperlinkListener(e ->
|
emailLabel.addHyperlinkListener(e ->
|
||||||
{
|
{
|
||||||
if (HyperlinkEvent.EventType.ACTIVATED.equals(e.getEventType()) && e.getURL() != null)
|
if (HyperlinkEvent.EventType.ACTIVATED.equals(e.getEventType()) && e.getURL() != null && e.getURL().toString().equals(RUNELITE_LOGIN))
|
||||||
{
|
{
|
||||||
if (e.getURL().toString().equals(RUNELITE_LOGIN))
|
executor.execute(sessionManager::login);
|
||||||
{
|
|
||||||
executor.execute(sessionManager::login);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -68,18 +68,15 @@ public class JRichTextPane extends JEditorPane
|
|||||||
{
|
{
|
||||||
linkHandler = e ->
|
linkHandler = e ->
|
||||||
{
|
{
|
||||||
if (HyperlinkEvent.EventType.ACTIVATED.equals(e.getEventType()) && e.getURL() != null)
|
if (HyperlinkEvent.EventType.ACTIVATED.equals(e.getEventType()) && e.getURL() != null && Desktop.isDesktopSupported())
|
||||||
{
|
{
|
||||||
if (Desktop.isDesktopSupported())
|
try
|
||||||
{
|
{
|
||||||
try
|
Desktop.getDesktop().browse(e.getURL().toURI());
|
||||||
{
|
}
|
||||||
Desktop.getDesktop().browse(e.getURL().toURI());
|
catch (URISyntaxException | IOException ex)
|
||||||
}
|
{
|
||||||
catch (URISyntaxException | IOException ex)
|
log.warn("Error opening link", ex);
|
||||||
{
|
|
||||||
log.warn("Error opening link", ex);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user