Skip to content

Commit

Permalink
Fix more event queue issues
Browse files Browse the repository at this point in the history
  • Loading branch information
comp500 committed Jul 12, 2020
1 parent 842427e commit fc4cd60
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/main/java/link/infra/packwiz/installer/bootstrap/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -256,14 +256,16 @@ public ConnMonitorInputStream(URLConnection conn, String message, String note) {
private void setup() throws IOException {
if (in == null) {
try {
EventQueue.invokeLater(() -> mon.setProgress(0));
size = conn.getContentLength();
in = conn.getInputStream();
if (size > -1) {
mon.setMaximum(size);
}
EventQueue.invokeLater(() -> {
mon.setProgress(0);
if (size > -1) {
mon.setMaximum(size);
}
});
} catch (IOException e) {
mon.close();
EventQueue.invokeLater(() -> mon.close());
throw e;
}
}
Expand Down

0 comments on commit fc4cd60

Please sign in to comment.