[Fix] nullfix at player born

This commit is contained in:
hartie95 2023-05-09 19:41:25 +02:00
parent 0daf58c1e3
commit 21dec2fec0

View File

@ -17,6 +17,7 @@ import lombok.AccessLevel;
import lombok.Builder; import lombok.Builder;
import lombok.Data; import lombok.Data;
import lombok.experimental.FieldDefaults; import lombok.experimental.FieldDefaults;
import lombok.val;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@ -116,9 +117,11 @@ public class PlayerActivityData {
} }
public static WatcherInfo init(ActivityWatcher watcher) { public static WatcherInfo init(ActivityWatcher watcher) {
val watcherData= watcher.getActivityWatcherData();
val progress = watcherData!=null ? watcherData.getProgress() : 0;
return WatcherInfo.of() return WatcherInfo.of()
.watcherId(watcher.getWatcherId()) .watcherId(watcher.getWatcherId())
.totalProgress(watcher.getActivityWatcherData().getProgress()) .totalProgress(progress)
.isTakenReward(false) .isTakenReward(false)
.build(); .build();
} }