Fixed possible NullPointer on bank save

This commit is contained in:
Fabrizio La Rosa 2020-06-18 03:56:52 +02:00
parent e60c2f85d7
commit f73ac5d5ba
2 changed files with 10 additions and 2 deletions

View File

@ -80,6 +80,10 @@ public class BankManager {
}
public List<Transaction> getTransactionList(Player player) {
return log.get(player.getUniqueId());
return getTransactionList(player.getUniqueId());
}
public List<Transaction> getTransactionList(UUID uuid) {
return log.get(uuid);
}
}

View File

@ -255,7 +255,7 @@ public class PlayerData {
}
public void save() {
transactions = BankManager.getInstance().getTransactionList(getPlayer());
transactions = BankManager.getInstance().getTransactionList(getPlayerUUID());
Config config = getConfig();
FileConfiguration configLoad = config.getFileConfiguration();
configLoad.set("Statistics.Island.Playtime", getPlaytime());
@ -287,6 +287,10 @@ public class PlayerData {
return Bukkit.getPlayer(uuid);
}
public UUID getPlayerUUID() {
return uuid;
}
public List<Transaction> getTransactions() {
return transactions;
}