From 53997073cbd99e3f02773c2bdf7edad04cb0dbf7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Mon, 16 Mar 2009 00:44:09 +0100 Subject: [PATCH] =?utf8?q?Don=E2=80=99t=20add=20a=20page=20if=20it?= =?utf8?q?=E2=80=99s=20not=20a=20valid=20freenet=20page.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/net/pterodactylus/arachne/core/URLFetcher.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/net/pterodactylus/arachne/core/URLFetcher.java b/src/net/pterodactylus/arachne/core/URLFetcher.java index e0062e3..de09f71 100644 --- a/src/net/pterodactylus/arachne/core/URLFetcher.java +++ b/src/net/pterodactylus/arachne/core/URLFetcher.java @@ -139,9 +139,13 @@ class URLFetcher implements Runnable, ParserListener { URL newLink = null; try { newLink = new URL(url, linkTarget); - Page newPage = Page.fromURL(newLink); - if (newPage != null) { - collectedPages.add(newPage); + try { + Page newPage = Page.fromURL(newLink); + if (newPage != null) { + collectedPages.add(newPage); + } + } catch (IllegalArgumentException iae1) { + /* ignore. */ } } catch (MalformedURLException mue1) { logger.log(Level.WARNING, "Could not create URL from “" + url + "” and “" + linkTarget + "”.", mue1); -- 2.7.4