diff --git a/src/main/java/club/joylink/rtss/services/cgy/CgyStatsService.java b/src/main/java/club/joylink/rtss/services/cgy/CgyStatsService.java index 890c5d50d..95cbadef7 100644 --- a/src/main/java/club/joylink/rtss/services/cgy/CgyStatsService.java +++ b/src/main/java/club/joylink/rtss/services/cgy/CgyStatsService.java @@ -122,10 +122,12 @@ public class CgyStatsService { public void syncUserSimulationUsing(UserSimulationRecordEvent event) { UserSimulationRecord record = event.getRecord(); CgyStatsBO cgyStatsBO = functionStatsMap.get(record.getFunctionId()); - cgyStatsBO.getVisitor().incrementAndGet(); - cgyStatsBO.getUserSet().add(record.getUserId()); - cgyStatsBO.getDuration().addAndGet(record.getDuration()); - cgyStatsBO.getChange().set(true); + if (Objects.nonNull(cgyStatsBO)) { + cgyStatsBO.getVisitor().incrementAndGet(); + cgyStatsBO.getUserSet().add(record.getUserId()); + cgyStatsBO.getDuration().addAndGet(record.getDuration()); + cgyStatsBO.getChange().set(true); + } } /**