mirror of
https://github.com/ColdeZhang/Dominion.git
synced 2024-12-24 06:08:55 +08:00
修复了缓存中的一个潜在空值
This commit is contained in:
parent
da10ce05e2
commit
fe623f41a2
2
pom.xml
2
pom.xml
@ -6,7 +6,7 @@
|
||||
|
||||
<groupId>cn.lunadeer</groupId>
|
||||
<artifactId>Dominion</artifactId>
|
||||
<version>1.29.0-beta</version>
|
||||
<version>1.29.1-beta</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>Dominion</name>
|
||||
|
@ -124,9 +124,11 @@ public class Cache {
|
||||
if (last_in_dom_id != null) {
|
||||
last_dominion = id_dominions.get(last_in_dom_id);
|
||||
}
|
||||
if (last_in_dom_id != null && dominion_children.get(last_in_dom_id).isEmpty() && isInDominion(last_dominion, player)) {
|
||||
// 如果玩家仍在领地内,且领地没有子领地,则直接返回
|
||||
return last_dominion;
|
||||
if (isInDominion(last_dominion, player)) {
|
||||
if (dominion_children.get(last_in_dom_id) == null) {
|
||||
// 如果玩家仍在领地内,且领地没有子领地,则直接返回
|
||||
return last_dominion;
|
||||
}
|
||||
}
|
||||
DominionDTO current_dominion = getLocInDominionDTO(world_dominion_tree.get(player.getWorld().getName()), player.getLocation());
|
||||
int last_dom_id = last_dominion == null ? -1 : last_dominion.getId();
|
||||
|
Loading…
Reference in New Issue
Block a user