Catch some more (undocumented) exceptions by FreenetURI.
[Sone.git] / 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);