Only add parsed Sone if it is not null.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sat, 16 Oct 2010 09:32:32 +0000 (11:32 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sat, 16 Oct 2010 09:32:32 +0000 (11:32 +0200)
src/main/java/net/pterodactylus/sone/core/Core.java

index b2aa43d..94d1169 100644 (file)
@@ -313,7 +313,9 @@ public class Core extends AbstractService {
                        FreenetURI realRequestUri = new FreenetURI(requestUri).setMetaString(new String[] { "sone.xml" });
                        FetchResult fetchResult = freenetInterface.fetchUri(realRequestUri);
                        Sone parsedSone = soneDownloader.parseSone(null, fetchResult, realRequestUri);
-                       addSone(parsedSone);
+                       if (parsedSone != null) {
+                               addSone(parsedSone);
+                       }
                } catch (MalformedURLException mue1) {
                        logger.log(Level.INFO, "Could not create URI from “" + requestUri + "”.", mue1);
                }