client: fix npe during first build

This commit is contained in:
TheRealNull
2021-01-15 22:47:41 -08:00
parent 402c386060
commit 97481a5623

View File

@@ -140,7 +140,7 @@ public class ClientLoader implements Supplier<Applet>
// in the jar. Otherwise the jar can change on disk and can break future classloads.
File oprsInjected = new File(System.getProperty("user.home") + "/.openosrs/cache/injected-client.jar");
InputStream initialStream = RuneLite.class.getResourceAsStream("injected-client.oprs");
if (oprsInjected.length() != RuneLite.class.getResource("injected-client.oprs").getFile().length())
if (!oprsInjected.exists() || oprsInjected.length() != RuneLite.class.getResource("injected-client.oprs").getFile().length())
FileUtils.copyInputStreamToFile(initialStream, oprsInjected);
classLoader = createJarClassLoader(oprsInjected);