aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/kr/syeyoung/dungeonsguide/customurl
diff options
context:
space:
mode:
authorsyeyoung <42869671+cyoung06@users.noreply.github.com>2020-12-09 21:25:28 +0900
committersyeyoung <42869671+cyoung06@users.noreply.github.com>2020-12-09 21:25:28 +0900
commitcbd22473c62d076b25543611894da001685f5e21 (patch)
tree699825ef52d752aa7e0cb973f211b94dbd050969 /src/main/java/kr/syeyoung/dungeonsguide/customurl
parent2976b083cbe99626fd815f73c0b904d0f9339b15 (diff)
downloadSkyblock-Dungeons-Guide-cbd22473c62d076b25543611894da001685f5e21.tar.gz
Skyblock-Dungeons-Guide-cbd22473c62d076b25543611894da001685f5e21.tar.bz2
Skyblock-Dungeons-Guide-cbd22473c62d076b25543611894da001685f5e21.zip
exception for development
Diffstat (limited to 'src/main/java/kr/syeyoung/dungeonsguide/customurl')
-rw-r--r--src/main/java/kr/syeyoung/dungeonsguide/customurl/DGURLConnection.java10
1 files changed, 7 insertions, 3 deletions
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());
+ }
}
}