From cbd22473c62d076b25543611894da001685f5e21 Mon Sep 17 00:00:00 2001 From: syeyoung <42869671+cyoung06@users.noreply.github.com> Date: Wed, 9 Dec 2020 21:25:28 +0900 Subject: exception for development --- .../kr/syeyoung/dungeonsguide/customurl/DGURLConnection.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/main/java/kr/syeyoung/dungeonsguide/customurl') diff --git a/src/main/java/kr/syeyoung/dungeonsguide/customurl/DGURLConnection.java b/src/main/java/kr/syeyoung/dungeonsguide/customurl/DGURLConnection.java index 5f68ad97..06aec0d8 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/customurl/DGURLConnection.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/customurl/DGURLConnection.java @@ -31,8 +31,12 @@ public class DGURLConnection extends URLConnection { } @Override public InputStream getInputStream() throws IOException { - String path = url.getPath().substring(1); - if (!authenticator.getDynamicResources().containsKey(path)) throw new FileNotFoundException(); - return new ByteArrayInputStream(authenticator.getDynamicResources().get(path)); + if (authenticator != null) { + String path = url.getPath().substring(1); + if (!authenticator.getDynamicResources().containsKey(path)) throw new FileNotFoundException(); + return new ByteArrayInputStream(authenticator.getDynamicResources().get(path)); + } else { + return DGURLConnection.class.getResourceAsStream(url.getPath()); + } } } -- cgit