Skip to content

fix: prevent crash when flash sale expiry date is null or empty#25

Merged
razaghimahdi merged 2 commits intorazaghimahdi:masterfrom
amirchi007:master
Apr 23, 2025
Merged

fix: prevent crash when flash sale expiry date is null or empty#25
razaghimahdi merged 2 commits intorazaghimahdi:masterfrom
amirchi007:master

Conversation

@amirchi007
Copy link
Contributor

  • Added safe parsing for expiredAt using DateTimeConverter with null fallback
  • Avoided showing TimerBox if time is null
  • Improved app stability on Home screen when flashSale is missing expiry date

- Added safe parsing for `expiredAt` using DateTimeConverter with null fallback
- Avoided showing TimerBox if `time` is null
- Improved app stability on Home screen when flashSale is missing expiry date
…hen invalid

- Added extension function `String?.toLocalDateTimeOrNull()` to safely parse nullable or invalid date strings.
- Used `AnimatedVisibility` to show/hide `TimerBox` only when `expiredAt` is valid.
- Ensured `HomeState` remains non-nullable by providing fallback time value.
- Prevented crashes when flashSale has null or malformed expiredAt values.
@amirchi007 amirchi007 requested a review from razaghimahdi April 22, 2025 18:12
Copy link
Owner

@razaghimahdi razaghimahdi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good

@razaghimahdi razaghimahdi merged commit d2fbf5c into razaghimahdi:master Apr 23, 2025
5 of 6 checks passed
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.

2 participants