Skip to content

Commit

Permalink
Fix [#144] 카테고리 생성 시 mset이 없어도 생성될 수 있게 null 핸들링 (#146)
Browse files Browse the repository at this point in the history
  • Loading branch information
geniusYoo authored Jul 18, 2024
2 parents 8b6f281 + 21a3470 commit 8fd891c
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,11 @@ public class MsetService {

public void createByCategory(CategoryCreateRequest categoryCreateRequest, Long categoryId) {
List<Mset> msetList = categoryCreateRequest.msets();
for (Mset mset : msetList) {
mset = msetRepository.save(Mset.create(mset.getName(), mset.getUrl()));
categoryMsetRepository.save(CategoryMset.create(categoryId, mset.getId()));
if (msetList != null) {
for (Mset mset : msetList) {
mset = msetRepository.save(Mset.create(mset.getName(), mset.getUrl()));
categoryMsetRepository.save(CategoryMset.create(categoryId, mset.getId()));
}
}
}

Expand Down

0 comments on commit 8fd891c

Please sign in to comment.