Skip to content

Commit

Permalink
BlobLibUpdater will no longer log if there's no internet connection
Browse files Browse the repository at this point in the history
  • Loading branch information
anjoismysign committed Jan 5, 2024
1 parent 2909d8b commit 47fa786
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/main/java/us/mytheria/bloblib/BlobLibUpdater.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.ProtocolException;
import java.net.URL;
import java.net.*;
import java.nio.file.Files;
import java.nio.file.Path;

Expand All @@ -43,7 +40,7 @@ protected BlobLibUpdater(BlobLib plugin) {
*/
public void reload() {
getLatestUrl();
updateAvailable = !isLatestVersion();
updateAvailable = latestVersion != null && !isLatestVersion();
listener.reload(updateAvailable);
}

Expand Down Expand Up @@ -126,6 +123,8 @@ private String getLatestUrl() {
BufferedReader reader;
try {
reader = new BufferedReader(new InputStreamReader(connection.getInputStream()));
} catch (UnknownHostException ignored) {
return null;
} catch (IOException e) {
e.printStackTrace();
return null;
Expand Down

0 comments on commit 47fa786

Please sign in to comment.