mirror of
https://github.com/correl/mage.git
synced 2024-11-15 03:00:16 +00:00
Fixed NPE
This commit is contained in:
parent
8f80d2d5b1
commit
12b8c12d74
1 changed files with 10 additions and 8 deletions
|
@ -29,14 +29,16 @@ public class TablesUtil {
|
|||
public static int findTableRowFromSearchId(Object tableModel, String searchId) {
|
||||
// tableUUID;gameUUID
|
||||
int row = -1;
|
||||
if (tableModel instanceof TablesTableModel) {
|
||||
row = ((TablesTableModel) tableModel).findRowByTableAndGameInfo(searchId);
|
||||
} else if (tableModel instanceof MatchesTableModel) {
|
||||
row = ((MatchesTableModel) tableModel).findRowByTableAndGameInfo(searchId);
|
||||
} else if (tableModel instanceof TournamentMatchesTableModel) {
|
||||
row = ((TournamentMatchesTableModel) tableModel).findRowByTableAndGameInfo(searchId);
|
||||
} else {
|
||||
logger.error("Not supported tables model " + tableModel.getClass().toString());
|
||||
if (searchId != null) {
|
||||
if (tableModel instanceof TablesTableModel) {
|
||||
row = ((TablesTableModel) tableModel).findRowByTableAndGameInfo(searchId);
|
||||
} else if (tableModel instanceof MatchesTableModel) {
|
||||
row = ((MatchesTableModel) tableModel).findRowByTableAndGameInfo(searchId);
|
||||
} else if (tableModel instanceof TournamentMatchesTableModel) {
|
||||
row = ((TournamentMatchesTableModel) tableModel).findRowByTableAndGameInfo(searchId);
|
||||
} else {
|
||||
logger.error("Not supported tables model " + tableModel.getClass().toString());
|
||||
}
|
||||
}
|
||||
return row;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue