mirror of
https://github.com/correl/mage.git
synced 2024-12-24 11:50:45 +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
|
||||
java.util.List<String> serverMessages = SessionHandler.getServerMessages();
|
||||
synchronized (this) {
|
||||
this.messages = serverMessages;
|
||||
if (serverMessages != null) {
|
||||
this.messages = serverMessages;
|
||||
} else {
|
||||
this.messages = new ArrayList<>();
|
||||
}
|
||||
|
||||
this.currentMessage = 0;
|
||||
}
|
||||
if (serverMessages.isEmpty()) {
|
||||
if (this.messages.isEmpty()) {
|
||||
this.jPanelBottom.setVisible(false);
|
||||
} else {
|
||||
this.jPanelBottom.setVisible(true);
|
||||
URLHandler.RemoveMouseAdapter(jLabelFooterText);
|
||||
URLHandler.handleMessage(serverMessages.get(0), this.jLabelFooterText);
|
||||
this.jButtonFooterNext.setVisible(serverMessages.size() > 1);
|
||||
URLHandler.handleMessage(this.messages.get(0), this.jLabelFooterText);
|
||||
this.jButtonFooterNext.setVisible(this.messages.size() > 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue