mirror of
https://github.com/magefree/mage.git
synced 2025-12-22 03:22:00 -08:00
Fixed some possible NPE of server.
This commit is contained in:
parent
bb0be3aea3
commit
65fdaba28d
2 changed files with 36 additions and 29 deletions
|
|
@ -700,6 +700,7 @@ public class TableController {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void matchEnd() {
|
private void matchEnd() {
|
||||||
|
if (match != null) {
|
||||||
for (Entry<UUID, UUID> entry: userPlayerMap.entrySet()) {
|
for (Entry<UUID, UUID> entry: userPlayerMap.entrySet()) {
|
||||||
MatchPlayer matchPlayer = match.getPlayer(entry.getValue());
|
MatchPlayer matchPlayer = match.getPlayer(entry.getValue());
|
||||||
// opponent(s) left during sideboarding
|
// opponent(s) left during sideboarding
|
||||||
|
|
@ -734,6 +735,7 @@ public class TableController {
|
||||||
// free resources no longer needed
|
// free resources no longer needed
|
||||||
match.cleanUpOnMatchEnd(ConfigSettings.getInstance().isSaveGameActivated());
|
match.cleanUpOnMatchEnd(ConfigSettings.getInstance().isSaveGameActivated());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private synchronized void setupTimeout(int seconds) {
|
private synchronized void setupTimeout(int seconds) {
|
||||||
cancelTimeout();
|
cancelTimeout();
|
||||||
|
|
|
||||||
|
|
@ -231,6 +231,11 @@ class TableListSorter implements Comparator<Table> {
|
||||||
return 1; // two has higher priority
|
return 1; // two has higher priority
|
||||||
} else if (one.getEndTime() == null) {
|
} else if (one.getEndTime() == null) {
|
||||||
if (two.getEndTime() == null) {
|
if (two.getEndTime() == null) {
|
||||||
|
if (two.getStartTime() == null) {
|
||||||
|
return -1;
|
||||||
|
} else if (one.getStartTime() == null) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
return two.getStartTime().compareTo(one.getStartTime());
|
return two.getStartTime().compareTo(one.getStartTime());
|
||||||
} else {
|
} else {
|
||||||
return -1;
|
return -1;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue