From 21dec2fec0e919704a3dcebac51c55149c3d73f2 Mon Sep 17 00:00:00 2001 From: hartie95 Date: Tue, 9 May 2023 19:41:25 +0200 Subject: [PATCH] [Fix] nullfix at player born --- .../emu/grasscutter/game/activity/PlayerActivityData.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/emu/grasscutter/game/activity/PlayerActivityData.java b/src/main/java/emu/grasscutter/game/activity/PlayerActivityData.java index 7b95ec06..5df21ae1 100644 --- a/src/main/java/emu/grasscutter/game/activity/PlayerActivityData.java +++ b/src/main/java/emu/grasscutter/game/activity/PlayerActivityData.java @@ -17,6 +17,7 @@ import lombok.AccessLevel; import lombok.Builder; import lombok.Data; import lombok.experimental.FieldDefaults; +import lombok.val; import java.util.ArrayList; import java.util.List; @@ -116,9 +117,11 @@ public class PlayerActivityData { } public static WatcherInfo init(ActivityWatcher watcher) { + val watcherData= watcher.getActivityWatcherData(); + val progress = watcherData!=null ? watcherData.getProgress() : 0; return WatcherInfo.of() .watcherId(watcher.getWatcherId()) - .totalProgress(watcher.getActivityWatcherData().getProgress()) + .totalProgress(progress) .isTakenReward(false) .build(); }