Skip to content

fix: getDiscountRate에서 정가 0일 때 발생하는 오류 수정 - #71

Merged
bongguma merged 1 commit into
mainfrom
fix/get_discount_rate
Jul 10, 2026
Merged

fix: getDiscountRate에서 정가 0일 때 발생하는 오류 수정#71
bongguma merged 1 commit into
mainfrom
fix/get_discount_rate

Conversation

@bongguma

Copy link
Copy Markdown
Contributor

Summary

  • getDiscountRate에서 정가(this)가 0일 때 salePrice / this 연산이 NaN(0/0) 또는 Infinity(x/0)가 되어 .round() 호출 시 예외가 발생하던 문제를 수정
  • 정가가 0이면 salePrice 값과 무관하게 할인율 0을 반환하도록 가드 추가
  • 저장소 내 유일한 호출처인 WdsItemCard의 가격 표시 로직도 함께 안전해짐

Test plan

  • dart analyze 통과 확인 (기존 무관한 deprecation 경고 1건 외 신규 이슈 없음)
  • Widgetbook에서 WdsItemCard에 정가/할인가 0 조합으로 렌더링 확인

🤖 Generated with Claude Code

정가(this)가 0이면 salePrice 값과 무관하게 0/0(NaN) 또는 x/0(Infinity)
나눗셈 결과로 round() 호출 시 예외가 발생하던 문제를 가드로 방지

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

🎨 Widgetbook Preview

🧭 Branch: fix/get_discount_rate
🔗 Preview URL

💡 This preview will be updated automatically when you push new commits.

@bongguma
bongguma merged commit 5a829fc into main Jul 10, 2026
1 check passed
@bongguma
bongguma deleted the fix/get_discount_rate branch July 10, 2026 01:32
@bongguma bongguma changed the title fix: getDiscountRate에서 정가 0일 때 발생하는 크래시 수정 fix: getDiscountRate에서 정가 0일 때 발생하는 오류 수정 Jul 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant