From a334e4928461a2855322a64add46a9f8f5be35e9 Mon Sep 17 00:00:00 2001 From: emost22 Date: Sat, 20 Jul 2024 21:44:59 +0900 Subject: [PATCH] Fix: if userVo is null, random --- .../service/business/question/RandomQuestionBusiness.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/sirius/spurt/service/business/question/RandomQuestionBusiness.java b/src/main/java/com/sirius/spurt/service/business/question/RandomQuestionBusiness.java index e7cc04c..eb7afc6 100644 --- a/src/main/java/com/sirius/spurt/service/business/question/RandomQuestionBusiness.java +++ b/src/main/java/com/sirius/spurt/service/business/question/RandomQuestionBusiness.java @@ -45,7 +45,11 @@ public Result execute(Dto input) { } final UserVo userVo = userProvider.getUserInfo(input.getUserId()); - JobGroup jobGroup = userVo.getJobGroup(); + JobGroup jobGroup = null; + if (userVo != null) { + jobGroup = userVo.getJobGroup(); + } + return RandomQuestionBusinessMapper.INSTANCE.toResult( questionProvider.randomQuestion( jobGroup, input.getUserId(), input.getCount(), input.getCategory()));