Skip to content

Commit

Permalink
Merge pull request #411 from depromeet/fix/406-memory-detail-id-npe
Browse files Browse the repository at this point in the history
fix: ImmutableCollections 문제 해결
  • Loading branch information
ywonchae1 authored Sep 10, 2024
2 parents 9cde333 + 6144b9a commit 0eab87f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import java.time.LocalDate;
import java.time.YearMonth;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
Expand Down Expand Up @@ -209,7 +210,10 @@ public MemoryAndDetailId findMemoryAndDetailIdsByMemberId(Long memberId) {
.fetch();
List<Long> memoryIds = result.stream().map(r -> r.get(memory.id)).toList();
List<Long> memoryDetailIds =
result.stream().map(r -> r.get(memory.memoryDetail.id)).toList();
result.stream()
.map(r -> r.get(memory.memoryDetail.id))
.filter(Objects::nonNull)
.toList();
return new MemoryAndDetailId(memoryIds, memoryDetailIds);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
import com.depromeet.reaction.port.in.usecase.DeleteReactionUseCase;
import com.depromeet.reaction.port.in.usecase.GetReactionUseCase;
import com.depromeet.type.auth.AuthErrorType;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.ThreadLocalRandom;
import lombok.RequiredArgsConstructor;
Expand Down Expand Up @@ -136,7 +135,6 @@ public void deleteAccount(Long memberId) {
getMemoryUseCase.findMemoryAndDetailIdsByMemberId(memberId);
List<Long> memoryIds = memoryAndDetailId.memoryIds();
List<Long> memoryDetailIds = memoryAndDetailId.memoryDetailIds();
memoryDetailIds.removeAll(Collections.singletonList(null));
// Following memory log 삭제
followingMemoryLogUseCase.deleteAllByMemoryIds(memoryIds);
// Reaction 조회
Expand Down

0 comments on commit 0eab87f

Please sign in to comment.