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()));