From bc2a6cc23e93037cae7f52815f20bdf24504ce5d Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Tue, 17 Mar 2009 00:10:44 +0100 Subject: [PATCH] =?utf8?q?Don=E2=80=99t=20try=20to=20parse=20when=20no=20p?= =?utf8?q?arser=20was=20found.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/net/pterodactylus/arachne/core/URLFetcher.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/net/pterodactylus/arachne/core/URLFetcher.java b/src/net/pterodactylus/arachne/core/URLFetcher.java index de09f71..ea109d0 100644 --- a/src/net/pterodactylus/arachne/core/URLFetcher.java +++ b/src/net/pterodactylus/arachne/core/URLFetcher.java @@ -121,6 +121,10 @@ class URLFetcher implements Runnable, ParserListener { urlInputStream = urlConnection.getInputStream(); hashInputStream = new MessageDigestInputStream(urlInputStream, messageDigest); Parser parser = parserFactory.getParser(contentType); + if (parser == null) { + logger.log(Level.INFO, "No parser found for “" + contentType + "”."); + return; + } parser.parse(this, hashInputStream, "UTF-8"); hash = messageDigest.digest(); } catch (IOException ioe1) { -- 2.7.4