fix: getDiscountRate에서 정가 0일 때 발생하는 오류 수정 - #71
Merged
Conversation
정가(this)가 0이면 salePrice 값과 무관하게 0/0(NaN) 또는 x/0(Infinity) 나눗셈 결과로 round() 호출 시 예외가 발생하던 문제를 가드로 방지 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
🎨 Widgetbook Preview 🧭 Branch: 💡 This preview will be updated automatically when you push new commits. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
getDiscountRate에서 정가(this)가 0일 때salePrice / this연산이NaN(0/0) 또는Infinity(x/0)가 되어.round()호출 시 예외가 발생하던 문제를 수정salePrice값과 무관하게 할인율 0을 반환하도록 가드 추가WdsItemCard의 가격 표시 로직도 함께 안전해짐Test plan
dart analyze통과 확인 (기존 무관한 deprecation 경고 1건 외 신규 이슈 없음)WdsItemCard에 정가/할인가 0 조합으로 렌더링 확인🤖 Generated with Claude Code