From f97f5ad803fba62e3a38c31b74e027c0214ed41d Mon Sep 17 00:00:00 2001 From: ENORMOUZ <68216143+ENORMOUZ@users.noreply.github.com> Date: Sun, 2 Apr 2023 04:28:20 +0800 Subject: [PATCH] fix: Fix party finder crash on housing island (#669) * fix: Fix party finder crash on housing island Fixes a bug where you will crash if you attempt to join a party in party finder, from your housing island. * Update src/main/java/com/wynntils/modules/richpresence/events/ClientEvents.java * Update src/main/java/com/wynntils/modules/richpresence/events/ClientEvents.java --------- Co-authored-by: Alex Todaro <3767283+P0keDev@users.noreply.github.com> --- .../modules/richpresence/events/ClientEvents.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/wynntils/modules/richpresence/events/ClientEvents.java b/src/main/java/com/wynntils/modules/richpresence/events/ClientEvents.java index 58bda96fb..5fa46f309 100644 --- a/src/main/java/com/wynntils/modules/richpresence/events/ClientEvents.java +++ b/src/main/java/com/wynntils/modules/richpresence/events/ClientEvents.java @@ -17,7 +17,14 @@ public class ClientEvents implements Listener { @SubscribeEvent public void onJoinParty(WynnSocialEvent.Party.Join e) { - RichPresenceModule.getModule().getRichPresence().setJoinSecret(new SecretContainer(e.getParty().getOwner(), Reference.getUserWorld().replaceAll("\\d+", ""), Integer.parseInt(Reference.getUserWorld().replace("WC", "").replace("HB", "")))); + int world; + try { + world = Integer.parseInt(Reference.getUserWorld().replace("WC", "").replace("HB", "")); + } catch (NumberFormatException npe) { + world = 0; + npe.printStackTrace(); + } + RichPresenceModule.getModule().getRichPresence().setJoinSecret(new SecretContainer(e.getParty().getOwner(), Reference.getUserWorld().replaceAll("\\d+", ""), world)); } @SubscribeEvent