From: David ‘Bombe’ Roden Date: Thu, 13 Jan 2011 20:31:24 +0000 (+0100) Subject: Catch some more (undocumented) exceptions by FreenetURI. X-Git-Tag: 0.3.7^2~1 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=1fe6e888c7276319080f8cfda12ae577ad19c2e8;p=Sone.git Catch some more (undocumented) exceptions by FreenetURI. --- diff --git a/src/main/java/net/pterodactylus/sone/text/FreenetLinkParser.java b/src/main/java/net/pterodactylus/sone/text/FreenetLinkParser.java index 73b33be..1ef77d2 100644 --- a/src/main/java/net/pterodactylus/sone/text/FreenetLinkParser.java +++ b/src/main/java/net/pterodactylus/sone/text/FreenetLinkParser.java @@ -170,6 +170,12 @@ public class FreenetLinkParser implements Parser { } catch (MalformedURLException mue1) { /* not a valid link, insert as plain text. */ parts.add(createPlainTextPart(link)); + } catch (NullPointerException npe1) { + /* FreenetURI sometimes throws these, too. */ + parts.add(createPlainTextPart(link)); + } catch (ArrayIndexOutOfBoundsException aioobe1) { + /* oh, and these, too. */ + parts.add(createPlainTextPart(link)); } } else if ((linkType == LinkType.HTTP) || (linkType == LinkType.HTTPS)) { name = link.substring(linkType == LinkType.HTTP ? 7 : 8);