mirror of
https://github.com/Zrips/Jobs.git
synced 2024-12-01 15:03:36 +01:00
Merge pull request #1724 from FireML/ownership-npe-fix
Add more null checks to BlockOwnerShip#clear
This commit is contained in:
commit
0ab6c20d21
@ -267,15 +267,18 @@ public class BlockOwnerShip {
|
||||
|
||||
public int clear(UUID uuid) {
|
||||
HashMap<String, blockLoc> ls = blockOwnerShips.remove(uuid);
|
||||
if (ls == null)
|
||||
if (ls == null) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
for (blockLoc one : ls.values()) {
|
||||
if (one.getBlock() != null) {
|
||||
one.getBlock().removeMetadata(metadataName, plugin);
|
||||
|
||||
Map<String, UUID> oldRecord = ownerMapByLocation.get(one.getWorldName());
|
||||
if (oldRecord != null)
|
||||
oldRecord.remove(one.toVectorString());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user