Catch some more (undocumented) exceptions by FreenetURI.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 13 Jan 2011 20:31:24 +0000 (21:31 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 13 Jan 2011 20:31:24 +0000 (21:31 +0100)
src/main/java/net/pterodactylus/sone/text/FreenetLinkParser.java

index 73b33be..1ef77d2 100644 (file)
@@ -170,6 +170,12 @@ public class FreenetLinkParser implements Parser<FreenetLinkParserContext> {
                                                } 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);