Setting maximumDate to null crashes android
See original GitHub issuePlatforms
Android only
Versions
Android
- react-native-modal-datetime-picker: v.7.4.2
- react-native: 0.59.3
- react: 16.8.6
Description
Setting maximumDate to null
will crash the android implementation of the datePicker.
Note that setting it to undefined
works as it should. Component stability could be improved by doing a check in the constructor of the component.
Reproducible Demo
Install react-native-modal-datetime-picker v 7.4.2. in a react native project.
Import the component on any screen of your app.
Use the component, setting maximumDate to null
.
Expected behaviour - no maximum date exists. Actual behaviour - component crashes with nullpointer.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:5 (4 by maintainers)
Top Results From Across the Web
How to set maximum date upto 7 days from current date in ...
Try This STEP 1- class MainActivity : AppCompatActivity() { @SuppressLint("SetTextI18n") override fun onCreate(savedInstanceState: Bundle?)
Read more >Detect and diagnose crashes - Android Developers
There are many situations that can cause a crash in your app. Some reasons are obvious, like checking for a null value or...
Read more >App Center Crashes for Android - Microsoft Learn
This method must only be used after Crashes has been started, it will always return null before start. Customize your usage of App...
Read more >7 ways to null crash Android Kotlin without using - Medium
If we have a possible null code, Android Studio will error out during ... set someAny to null , and when running it,...
Read more >How to fix Maps when it crashes - Android - Google Maps Help
Update Google Maps. Clear storage in the Settings app on your device. Android iPhone & iPad.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I haven’t tried the native android picker - it might be.
The reason why I reported it here / considered it a bug in this library instead of checking the native implementation is that the behaviour an RN Component should be similar on android and ios given the same input. The fix should be easy, you can essentially just add
props.maximumDate = props.maximumDate || undefined
to your components constructorClosing in favour of #301, which fixes the issue.