Merge pull request #2899 from open-osrs/work-the-first-build

client: fix npe during first build
This commit is contained in:
Tyler Bochard
2021-01-15 20:41:08 -08:00
committed by GitHub

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);