Skip to content

Commit

Permalink
fix: requireNonNull로 NPE 처리
Browse files Browse the repository at this point in the history
  • Loading branch information
Sangwook02 committed Dec 22, 2024
1 parent e188cfd commit 89e76a7
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import com.querydsl.core.types.dsl.BooleanExpression;
import com.querydsl.jpa.impl.JPAQueryFactory;
import java.util.List;
import java.util.Objects;
import lombok.RequiredArgsConstructor;

@RequiredArgsConstructor
Expand Down Expand Up @@ -34,11 +35,11 @@ public void deleteByStudyAndAchievementTypeAndMemberIds(
@Override
public long countByStudyIdAndAchievementTypeAndStudentIds(
Long studyId, AchievementType achievementType, List<Long> studentIds) {
return (long) queryFactory
return Objects.requireNonNull(queryFactory
.select(studyAchievement.count())
.from(studyAchievement)
.where(eqStudyId(studyId), eqAchievementType(achievementType), containsStudentId(studentIds))
.fetchOne();
.fetchOne());
}

private BooleanExpression eqStudyId(Long studyId) {
Expand Down

0 comments on commit 89e76a7

Please sign in to comment.