mirror of
https://github.com/magefree/mage.git
synced 2025-12-22 11:32:00 -08:00
introduced StringUtil class with .isEmpty(String input) and .isNotEmpty(String input), to replace str != null && str.length()>0 statements
This commit is contained in:
parent
fb15c79964
commit
f1cf9e7adb
47 changed files with 132 additions and 96 deletions
|
|
@ -405,33 +405,25 @@ public class NewTableDialog extends MageDialog {
|
|||
JOptionPane.showMessageDialog(MageFrame.getDesktop(), "Error creating table.", "Error", JOptionPane.ERROR_MESSAGE);
|
||||
return;
|
||||
}
|
||||
try {
|
||||
if (SessionHandler.joinTable(
|
||||
roomId,
|
||||
table.getTableId(),
|
||||
this.player1Panel.getPlayerName(),
|
||||
"Human", 1,
|
||||
DeckImporterUtil.importDeck(this.player1Panel.getDeckFile()),
|
||||
this.txtPassword.getText())) {
|
||||
for (TablePlayerPanel player : players) {
|
||||
if (!player.getPlayerType().equals("Human")) {
|
||||
if (!player.joinTable(roomId, table.getTableId())) {
|
||||
// error message must be send by the server
|
||||
SessionHandler.removeTable(roomId, table.getTableId());
|
||||
table = null;
|
||||
return;
|
||||
}
|
||||
if (SessionHandler.joinTable(
|
||||
roomId,
|
||||
table.getTableId(),
|
||||
this.player1Panel.getPlayerName(),
|
||||
"Human", 1,
|
||||
DeckImporterUtil.importDeck(this.player1Panel.getDeckFile()),
|
||||
this.txtPassword.getText())) {
|
||||
for (TablePlayerPanel player : players) {
|
||||
if (!player.getPlayerType().equals("Human")) {
|
||||
if (!player.joinTable(roomId, table.getTableId())) {
|
||||
// error message must be send by the server
|
||||
SessionHandler.removeTable(roomId, table.getTableId());
|
||||
table = null;
|
||||
return;
|
||||
}
|
||||
}
|
||||
this.hideDialog();
|
||||
return;
|
||||
}
|
||||
} catch (FileNotFoundException ex) {
|
||||
handleError(ex);
|
||||
} catch (IOException ex) {
|
||||
handleError(ex);
|
||||
} catch (ClassNotFoundException ex) {
|
||||
handleError(ex);
|
||||
this.hideDialog();
|
||||
return;
|
||||
}
|
||||
// JOptionPane.showMessageDialog(MageFrame.getDesktop(), "Error joining table.", "Error", JOptionPane.ERROR_MESSAGE);
|
||||
SessionHandler.removeTable(roomId, table.getTableId());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue