You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pdfbox.apache.org by ti...@apache.org on 2020/12/07 13:17:22 UTC
svn commit: r1884180 -
/pdfbox/branches/2.0/debugger/src/main/java/org/apache/pdfbox/debugger/pagepane/PagePane.java
Author: tilman
Date: Mon Dec 7 13:17:22 2020
New Revision: 1884180
URL: http://svn.apache.org/viewvc?rev=1884180&view=rev
Log:
PDFBOX-2941: Sonar fix
Modified:
pdfbox/branches/2.0/debugger/src/main/java/org/apache/pdfbox/debugger/pagepane/PagePane.java
Modified: pdfbox/branches/2.0/debugger/src/main/java/org/apache/pdfbox/debugger/pagepane/PagePane.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/debugger/src/main/java/org/apache/pdfbox/debugger/pagepane/PagePane.java?rev=1884180&r1=1884179&r2=1884180&view=diff
==============================================================================
--- pdfbox/branches/2.0/debugger/src/main/java/org/apache/pdfbox/debugger/pagepane/PagePane.java (original)
+++ pdfbox/branches/2.0/debugger/src/main/java/org/apache/pdfbox/debugger/pagepane/PagePane.java Mon Dec 7 13:17:22 2020
@@ -382,22 +382,20 @@ public class PagePane implements ActionL
@Override
public void mouseClicked(MouseEvent e)
{
- if (!currentURI.isEmpty())
+ if (!currentURI.isEmpty() &&
+ Desktop.isDesktopSupported() && Desktop.getDesktop().isSupported(Desktop.Action.BROWSE))
{
- if (Desktop.isDesktopSupported() && Desktop.getDesktop().isSupported(Desktop.Action.BROWSE))
+ try
{
- try
- {
- Desktop.getDesktop().browse(new URI(currentURI));
- }
- catch (URISyntaxException ex)
- {
- new ErrorDialog(ex).setVisible(true);
- }
- catch (IOException ex)
- {
- new ErrorDialog(ex).setVisible(true);
- }
+ Desktop.getDesktop().browse(new URI(currentURI));
+ }
+ catch (URISyntaxException ex)
+ {
+ new ErrorDialog(ex).setVisible(true);
+ }
+ catch (IOException ex)
+ {
+ new ErrorDialog(ex).setVisible(true);
}
}
}