diff --git a/hollow-ui-tools/src/main/java/com/netflix/hollow/ui/HollowUIRouter.java b/hollow-ui-tools/src/main/java/com/netflix/hollow/ui/HollowUIRouter.java index 65ec6008c4..e41ec5f275 100644 --- a/hollow-ui-tools/src/main/java/com/netflix/hollow/ui/HollowUIRouter.java +++ b/hollow-ui-tools/src/main/java/com/netflix/hollow/ui/HollowUIRouter.java @@ -121,9 +121,9 @@ protected boolean serveResource(HttpServletRequest req, HttpServletResponse resp resp.setContentType("image/png"); } - InputStream is = this.getClass().getResourceAsStream("/" + resourceName); - - IOUtils.copy(is, resp.getOutputStream()); + try (InputStream is = this.getClass().getResourceAsStream("/" + resourceName)) { + IOUtils.copy(is, resp.getOutputStream()); + } return true; } catch(Exception e){ return false;