mirror of
https://github.com/correl/mage.git
synced 2024-12-25 11:11:16 +00:00
Fixed NPE error/freeze on broken server connection
This commit is contained in:
parent
7d07c94bc9
commit
481b5f04ea
1 changed files with 9 additions and 4 deletions
|
@ -626,16 +626,21 @@ public class TablesPanel extends javax.swing.JPanel {
|
||||||
// reload server messages
|
// reload server messages
|
||||||
java.util.List<String> serverMessages = SessionHandler.getServerMessages();
|
java.util.List<String> serverMessages = SessionHandler.getServerMessages();
|
||||||
synchronized (this) {
|
synchronized (this) {
|
||||||
|
if (serverMessages != null) {
|
||||||
this.messages = serverMessages;
|
this.messages = serverMessages;
|
||||||
|
} else {
|
||||||
|
this.messages = new ArrayList<>();
|
||||||
|
}
|
||||||
|
|
||||||
this.currentMessage = 0;
|
this.currentMessage = 0;
|
||||||
}
|
}
|
||||||
if (serverMessages.isEmpty()) {
|
if (this.messages.isEmpty()) {
|
||||||
this.jPanelBottom.setVisible(false);
|
this.jPanelBottom.setVisible(false);
|
||||||
} else {
|
} else {
|
||||||
this.jPanelBottom.setVisible(true);
|
this.jPanelBottom.setVisible(true);
|
||||||
URLHandler.RemoveMouseAdapter(jLabelFooterText);
|
URLHandler.RemoveMouseAdapter(jLabelFooterText);
|
||||||
URLHandler.handleMessage(serverMessages.get(0), this.jLabelFooterText);
|
URLHandler.handleMessage(this.messages.get(0), this.jLabelFooterText);
|
||||||
this.jButtonFooterNext.setVisible(serverMessages.size() > 1);
|
this.jButtonFooterNext.setVisible(this.messages.size() > 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue