Don’t add a page if it’s not a valid freenet page.
[arachne.git] / src / net / pterodactylus / arachne / core / URLFetcher.java
index e0062e3..de09f71 100644 (file)
@@ -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);