diff --git a/src/main/java/ch/ethz/seb/sebserver/gui/RAPConfiguration.java b/src/main/java/ch/ethz/seb/sebserver/gui/RAPConfiguration.java index 705a48ed..2a862ab0 100644 --- a/src/main/java/ch/ethz/seb/sebserver/gui/RAPConfiguration.java +++ b/src/main/java/ch/ethz/seb/sebserver/gui/RAPConfiguration.java @@ -64,7 +64,10 @@ public class RAPConfiguration implements ApplicationConfiguration { application.addResource("fav_icon", new ResourceLoader() { @Override public InputStream getResourceAsStream(final String resourceName) throws IOException { - return RAPConfiguration.class.getClassLoader().getResourceAsStream("static/images/fav_icon.png"); + return Thread + .currentThread() + .getContextClassLoader() + .getResourceAsStream("static/images/fav_icon.png"); } }); diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/weblayer/api/CertificateController.java b/src/main/java/ch/ethz/seb/sebserver/webservice/weblayer/api/CertificateController.java index d03ca5c2..b5da333b 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/weblayer/api/CertificateController.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/weblayer/api/CertificateController.java @@ -226,11 +226,11 @@ public class CertificateController { .flatMap(certData -> this.userActivityLogDAO.log(UserLogActivityType.IMPORT, certData)) .getOrThrow(); + } catch (final RuntimeException re) { + IOUtils.closeQuietly(inputStream); + throw re; } catch (final Exception e) { IOUtils.closeQuietly(inputStream); - if (e instanceof RuntimeException) { - throw (RuntimeException) e; - } throw new RuntimeException(e); } }