question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Setting maximumDate to null crashes android

See original GitHub issue

Platforms

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:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
pmo022commented, Jun 14, 2019

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 constructor

0reactions
mmazzarolocommented, Oct 17, 2019

Closing in favour of #301, which fixes the issue.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found