Skip to content

Commit

Permalink
issue #67 custom browser only for valid urls
Browse files Browse the repository at this point in the history
  • Loading branch information
jeanatcismet committed Feb 11, 2019
1 parent 0a24191 commit 17c1c31
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/main/java/de/cismet/tools/BrowserLauncher.java
Original file line number Diff line number Diff line change
Expand Up @@ -631,10 +631,12 @@ public static void openURL(final String url) throws Exception {
log.debug("BrowserLauncher.openUrl:" + url); // NOI18N
}
boolean isValidUrl = false;
try {
new URL(url).toString();
isValidUrl = true;
} catch (final Exception ex) {
if (!url.toLowerCase().startsWith("file:")) {
try {
new URL(url).toString();
isValidUrl = true;
} catch (final Exception ex) {
}
}
if (isValidUrl && (customBrowserCmd != null)) {
final List<String> list = new ArrayList<>();
Expand Down

0 comments on commit 17c1c31

Please sign in to comment.