~singpolyma/cheogram-android

53f9e58b6bf50606f461099504fb406e5176f2d9 — Stephen Paul Weber a year ago 7133cbf
Don't crash, no matter why punycode fails
M src/main/java/eu/siacs/conversations/entities/Bookmark.java => src/main/java/eu/siacs/conversations/entities/Bookmark.java +1 -1
@@ 201,7 201,7 @@ public class Bookmark extends Element implements ListItem {
		} catch (final IllegalArgumentException e) {
			try {
				return tryFix ? getFullJid(gnu.inet.encoding.Punycode.encode(nick), false) : null;
			} catch (final gnu.inet.encoding.PunycodeException | ArrayIndexOutOfBoundsException e2) {
			} catch (final Exception e2) {
				return null;
			}
		}

M src/main/java/eu/siacs/conversations/entities/MucOptions.java => src/main/java/eu/siacs/conversations/entities/MucOptions.java +1 -1
@@ 626,7 626,7 @@ public class MucOptions {
        } catch (final IllegalArgumentException e) {
            try {
                return tryFix ? createJoinJid(gnu.inet.encoding.Punycode.encode(nick), false) : null;
            } catch (final gnu.inet.encoding.PunycodeException | ArrayIndexOutOfBoundsException e2) {
            } catch (final Exception e2) {
                return null;
            }
        }

M src/main/java/eu/siacs/conversations/parser/AbstractParser.java => src/main/java/eu/siacs/conversations/parser/AbstractParser.java +1 -1
@@ 158,7 158,7 @@ public abstract class AbstractParser {
			if (nickname == null && nicknameIn != null && nick != null && gnu.inet.encoding.Punycode.decode(nick).equals(nicknameIn)) {
				nickname = nicknameIn;
			}
		} catch (final gnu.inet.encoding.PunycodeException | ArrayIndexOutOfBoundsException e) { }
		} catch (final Exception e) { }
		Set<MucOptions.Hat> hats = new TreeSet<>();
		for (Element hat : hatsEl.getChildren()) {
			if ("hat".equals(hat.getName()) && ("urn:xmpp:hats:0".equals(hat.getNamespace()) || "xmpp:prosody.im/protocol/hats:1".equals(hat.getNamespace()))) {