From 8afc700f5f91b13a73d782a6b6898e70a7cd6989 Mon Sep 17 00:00:00 2001 From: ThatGamerBlue Date: Wed, 16 Jun 2021 19:09:33 +0100 Subject: [PATCH] fix client being fucked for new installs --- .../java/net/runelite/client/rs/ClientLoader.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/rs/ClientLoader.java b/runelite-client/src/main/java/net/runelite/client/rs/ClientLoader.java index c263d51aa7..d130f3d8ce 100644 --- a/runelite-client/src/main/java/net/runelite/client/rs/ClientLoader.java +++ b/runelite-client/src/main/java/net/runelite/client/rs/ClientLoader.java @@ -33,6 +33,7 @@ import com.openosrs.client.OpenOSRS; import java.applet.Applet; import java.io.ByteArrayOutputStream; import java.io.File; +import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; @@ -515,9 +516,12 @@ public class ClientLoader implements Supplier } catch (IOException ex) { - log.error("Failed to calculate hash for cached file, falling back to vanilla", ex); - updateCheckMode = VANILLA; - return; + if (!(ex instanceof FileNotFoundException)) + { + log.error("Failed to calculate hash for cached file, falling back to vanilla", ex); + updateCheckMode = VANILLA; + return; + } } byte[] currentInjected = ByteStreams.toByteArray(ClientLoader.class.getResourceAsStream(INJECTED_CLIENT_NAME)); @@ -525,6 +529,7 @@ public class ClientLoader implements Supplier if (!cachedInjected.exists() || !currentHash.equals(cachedHash)) { + cachedInjected.getParentFile().mkdirs(); Files.write(cachedInjected.toPath(), currentInjected); } }