From c2235c5c2c45b6ecd8bff981f2e657ab33e188a7 Mon Sep 17 00:00:00 2001 From: TudbuT Date: Mon, 14 Oct 2024 02:28:43 +0200 Subject: [PATCH] fix SCL findResource --- .../main/java/de/com/baseband/launcher/Loader.java | 2 +- .../launcher/classloader/SimpleClassLoader.java | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Loader/src/main/java/de/com/baseband/launcher/Loader.java b/Loader/src/main/java/de/com/baseband/launcher/Loader.java index 465aa5b..74cfd13 100644 --- a/Loader/src/main/java/de/com/baseband/launcher/Loader.java +++ b/Loader/src/main/java/de/com/baseband/launcher/Loader.java @@ -394,7 +394,7 @@ public class Loader implements Util { byte[] bytes = new StreamReader(stream).readAllAsBytes(); try(FileOutputStream os = new FileOutputStream(filename)) { os.write(bytes); - } + } catch (IOException ignored) { } stream = new ByteArrayInputStream(bytes); } ZipInputStream jar = new ZipInputStream(stream); diff --git a/Loader/src/main/java/de/com/baseband/launcher/classloader/SimpleClassLoader.java b/Loader/src/main/java/de/com/baseband/launcher/classloader/SimpleClassLoader.java index 156b78c..6e07fe6 100644 --- a/Loader/src/main/java/de/com/baseband/launcher/classloader/SimpleClassLoader.java +++ b/Loader/src/main/java/de/com/baseband/launcher/classloader/SimpleClassLoader.java @@ -23,11 +23,14 @@ public class SimpleClassLoader extends ClassLoader { @Override protected URL findResource(String name) { - try { - return URLWrapper.wrap(name, classes.get(name)); - } catch (MalformedURLException e) { - throw new RuntimeException(e); + if(classes.get(name) != null) { + try { + return URLWrapper.wrap(name, classes.get(name)); + } catch (MalformedURLException e) { + throw new RuntimeException(e); + } } + return null; } @Override