From 1fe6e888c7276319080f8cfda12ae577ad19c2e8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Thu, 13 Jan 2011 21:31:24 +0100 Subject: [PATCH] Catch some more (undocumented) exceptions by FreenetURI. --- src/main/java/net/pterodactylus/sone/text/FreenetLinkParser.java | 6 ++++++ 1 file changed, 6 insertions(+) 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); -- 2.7.4