florent37 / SingleDateAndTimePicker

You can now select a date and a time with only one widget !
Apache License 2.0
1.02k stars 333 forks source link

crash #236

Closed dflamingoY closed 4 years ago

dflamingoY commented 4 years ago
 Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'int java.util.TimeZone.getOffset(long)' on a null object reference
    at java.util.GregorianCalendar.computeFields(GregorianCalendar.java:2285)
    at java.util.GregorianCalendar.computeFields(GregorianCalendar.java:2254)
    at java.util.Calendar.complete(Calendar.java:1543)
    at java.util.GregorianCalendar.add(GregorianCalendar.java:897)
    at com.github.florent37.singledateandtimepicker.widget.WheelDayPicker.generateAdapterValues(WheelDayPicker.java:74)
    at com.github.florent37.singledateandtimepicker.widget.WheelPicker.<init>(WheelPicker.java:182)
    at com.github.florent37.singledateandtimepicker.widget.WheelDayPicker.<init>(WheelDayPicker.java:34)
Vidhyadharan24 commented 4 years ago

The app is crashing because the DateHelper.getTimeZone() method is returning a null object when no time zone is set, setting the default TimeZone when you init the picker via the TimeZone.getDefault() resolves the issue.