From 7126b1569e7c0ae5f584959ba3eda6897db53bf4 Mon Sep 17 00:00:00 2001 From: zhaodice <63996691+zhaodice@users.noreply.github.com> Date: Sat, 11 Jun 2022 19:34:25 +0800 Subject: [PATCH] make sure towerData is not null (#1240) * make sure towerData is not null * Update Player.java * add notice --- src/main/java/emu/grasscutter/game/player/Player.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/emu/grasscutter/game/player/Player.java b/src/main/java/emu/grasscutter/game/player/Player.java index c6c7079a2..b0bb3cff3 100644 --- a/src/main/java/emu/grasscutter/game/player/Player.java +++ b/src/main/java/emu/grasscutter/game/player/Player.java @@ -191,6 +191,7 @@ public class Player { this.nameCardList = new HashSet<>(); this.flyCloakList = new HashSet<>(); this.costumeList = new HashSet<>(); + this.towerData = new TowerData(); this.unlockedForgingBlueprints = new HashSet<>(); this.activeForges = new ArrayList<>(); @@ -483,6 +484,10 @@ public class Player { } public TowerData getTowerData() { + if(towerData==null){ + // because of mistake, null may be saved as storage at some machine, this if can be removed in future + towerData = new TowerData(); + } return towerData; }