From 4f151fae4adba009fc5e728d40fec0fcbcb8248e Mon Sep 17 00:00:00 2001 From: tiger_zhou Date: Mon, 19 Aug 2024 09:42:14 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=20=E4=BB=BF=E7=9C=9F?= =?UTF-8?q?=E9=94=80=E6=AF=81=E7=9A=84=E6=97=B6=E5=80=99=E5=8F=91=E9=80=81?= =?UTF-8?q?cgy=E6=97=B6=E9=97=B4=EF=BC=8C=E6=9C=89=E4=B8=AA=E5=8F=AF?= =?UTF-8?q?=E8=83=BD=E6=98=AF=E7=A9=BA=E7=9A=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../joylink/rtss/services/cgy/CgyStatsService.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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); + } } /**