Commit e65a5d3
fix(ios): remove potential division by zero minute interval (#997)
* fix: prevent division by zero crash in adjustMinimumDate when minuteInterval is 0
- Add safety check in adjustMinimumDate function to handle minuteInterval <= 0
- Return minimumDate unchanged when no valid interval is provided
- Add debug logging to track minuteInterval values for troubleshooting
- Fixes EXC_ARITHMETIC (EXC_I386_DIV) crash when modulo operation encounters zero divisor
This fixes crashes that occur when DateTimePicker is used without explicitly setting minuteInterval,
as the default value becomes 0 instead of the expected 1, causing division by zero in the modulo operation.
* refactor: reduce logging in adjustMinimumDate
Only log when minuteInterval <= 0 and we return date unchanged.
Remove verbose logging for normal operation to reduce console noise.
* Update RNDateTimePickerComponentView.mm
* Update ios/fabric/RNDateTimePickerComponentView.mm
---------
Co-authored-by: Vojtech Novak <vonovak@gmail.com>1 parent 535e554 commit e65a5d3
1 file changed
+5
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
25 | 30 | | |
26 | 31 | | |
27 | 32 | | |
| |||
0 commit comments