diff --git a/launcher/src/main/java/com/skcraft/launcher/install/HttpDownloader.java b/launcher/src/main/java/com/skcraft/launcher/install/HttpDownloader.java index 6c5aeea..ccc3f47 100644 --- a/launcher/src/main/java/com/skcraft/launcher/install/HttpDownloader.java +++ b/launcher/src/main/java/com/skcraft/launcher/install/HttpDownloader.java @@ -269,7 +269,7 @@ // We only want to try to resume a partial download if the request succeeded before // throwing an exception halfway through. If it didn't succeed, just throw the error. - if (tries >= tryCount || !request.isSuccessCode()) { + if (tries >= tryCount || !request.isConnected() || !request.isSuccessCode()) { throw e; } diff --git a/launcher/src/main/java/com/skcraft/launcher/util/HttpRequest.java b/launcher/src/main/java/com/skcraft/launcher/util/HttpRequest.java index 3f05cd3..6bf1457 100644 --- a/launcher/src/main/java/com/skcraft/launcher/util/HttpRequest.java +++ b/launcher/src/main/java/com/skcraft/launcher/util/HttpRequest.java @@ -266,6 +266,15 @@ } /** + * Check if a connection was ever made + * + * @return True if a connection is available, false otherwise + */ + public boolean isConnected() { + return conn != null; + } + + /** * Buffer the returned response. * * @return the buffered response